autofill-event icon indicating copy to clipboard operation
autofill-event copied to clipboard

update on input events

Open stevegal opened this issue 9 years ago • 3 comments

Chrome fires input events on autofill for things like username, so listen for these and resync.

Chrome doesn't allow password fields to be read in javascript before user interaction, so look for these and fire an autoFilled event on the element if this has happened.

stevegal avatar Nov 11 '15 23:11 stevegal

hmm I tried your code, but it is still not working the password field is not filled (before user interaction)

bettysteger avatar Nov 13 '15 12:11 bettysteger

Sorry i didn't make it clear, but if you want to pre-empt chrome filling in the value, your element must listen to the "autofilled" event I fire, then take appropriate action. Chrome will not allow us to read the value before user interaction, but we can get informed that it has autofilled. Not quite as seemless as tbosh, but now you can action.

stevegal avatar Nov 13 '15 23:11 stevegal

To be a bit more precise, you have to "element.bind('autoFilled',callback)" where callback defines what you want to do when a browser autofilled and hasn't yet updated the model. Apologies again, if this was not clear.

stevegal avatar Nov 13 '15 23:11 stevegal