vanilla-autofill-event
vanilla-autofill-event copied to clipboard
Can detect change in only one input
I'm using chrome. When chrome autofills my login form, it fires the event on username
's input. But it doesn't fire for change in password
. It's only when you click somewhere on the screen that the password's event fires.
What I want is it should fire events for both of the inputs, so that I can make appropriate style changes.
Same issue (I'm using the tbosch version). Can repro here on the test page: http://tbosch.github.io/autofill-event/test/manual/login-form.html. Not sure if its number of inputs or if its related to the fact that its a password field...
EDIT - Further research shows that Chrome security policy does not allow detection of password autofills until user interacts with the page in some way. For my case, I ended up just detecting the autofill of the username field and using that to trigger whatever I need for the password field as well. Not perfect but it works.
I set up custom listeners using setTimeout
. It's not a clean solution, but it works.