I have a form design with a floating label and an issue with Edge and Chrome autofill suggestion box. After a click on the input field, it moves down 30px (margin-top
) to make place for the label.
The issue is that the autofill suggestion select box does NOT move down those 30px, and it overlays the input field (full code).
When I click again in the input field, it moves down accordingly like I want it.
Now my question: Is it possible to move the browser suggestion box down alongside the input or maybe simulate a second focus on the input to refresh the autofill box location.
Edit
The suggestion box is not part of the DOM content, so I can't change it directly. That is not surprising.
What I'm asking is if there is any known workaround to make it move to the right place after my input has done its animation.
Floating labels are quite common, am I the first one confronted with this issue?
The location of the suggestion box just needs to be refreshed, a second manual click in the input field works, but is there really NO clean automated way?
If there is really not, I clearly see this as a browser bug, as the suggestion box is flat out on the wrong spot. Is there maybe an issue open already for the browsers, asking they put the suggestion box right below (or above) the input fields ALSO when they move? Wouldn't it make sense to "follow" the input field?
My autocomplete suggestions only pop up when the inputs have the name attribute. That made me wonder if I could trigger it after the transitionend by injecting the name attribute (using the label's htmlFor attribute). It works, but requires a second click to trigger the suggestions.
I know this isn't a perfect answer but hope it gets someone closer to a better workaround.