B
B
bellord2020-07-24 16:26:24
JavaScript
bellord, 2020-07-24 16:26:24

How to get autocomplete data?

Initial data:
the form, the data from which the chrome browser remembered.
inputs that have a dynamic positioning of the label (the name of the input). If the input is not filled, then the label is in place of the placeholder, if the focus is on the input or there is data, then the label smoothly goes higher.

The essence of the problem:
After loading the page (before clicking/tab on it!) the autocomplete data and the label are superimposed on each other.
after a click (anywhere) everything falls into place.
The script reads the input and sets the appropriate attribute, depending on its value CSS positions the label.

Features:
If you make a click / tab on the window, then css / js work out as planned.
Before the click/tab when getting the value of the input, we have an empty value, although it clearly has an autocomplete value.
Playing with settimeout and triggers didn't work.

Question:
How to get rid of the autocomplete artifact, leaving the old design and preserving the browser autocomplete fields.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hzzzzl, 2020-07-24
@hzzzzl

there is a pseudo-element :placeholder-shown
https://css-tricks.com/almanac/selectors/p/placeho...
it might come out to combine something like this without JS
https://css-tricks.com/css -only-floated-labels-with...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question