After my account is autocompleted by the browser, the entered password value will be empty. After I go to the password field, the value will become magical, there are also many events triggered by the browser that do not make sense. ( onChange to enter a password is not included.)
- Why is
input[type=password] empty? - Why doesn't autocomplete password input
onChange event?
(it fires on normal input) - Bonus question: why is there a second (unnecessary) focus / blur event?
1. Both inputs are set to type="text"
- Both inputs are received once (without autofill)

Note: my inputs are uncontrolled, but with state preservation, and I track state changes when focusing, blurring, changing
entered=true when value is enteredfocused=true when onFocus running, =false when onBlur runningpeek=true when I need to programmatically force type from password to text
2. The input signal is set to type="password"
(See how the form autocompletes.)


Interestingly, after clicking the PrtScr button in the browser, this value becomes available, and the form gets rendered - as when focusing the input manually.
source share