Reputation: 33
After migrating from Vaadin 8 to 14, browsers do not remember password. With some googling, the below link gives a solution, but I don't understand exactly what I need to do.
https://vaadin.com/forum/thread/17399734/leverage-browser-save-password-feature
Jouni Koivuviita said:
Vaadin input field components have a feature that allows you
to slot in a native input element, and thereby allow password managers to work (assuming you
do not have any other shadow roots in your DOM in the hierarchy above the input field).
<vaadin-text-field>
<input type="text" slot="input">
</vaadin-text-field>
How is this solution implemented in Java exactly ?
Thanks for help.
Upvotes: 0
Views: 76
Reputation: 8001
There are two "easy" solutions:
For the difficult solution, you need to use some low-level APIs to make the Java part of Flow replicate the HTML example that you quoted. It goes something like this:
TextField field = new TextField();
Element input = new Element("input");
input.setAttribute("slot", "input");
field.getElement().appendChild(input);
Upvotes: 2