Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Safari autocomplete not updating model #13291

Closed
segersb opened this issue Nov 10, 2015 · 7 comments
Closed

Safari autocomplete not updating model #13291

segersb opened this issue Nov 10, 2015 · 7 comments

Comments

@segersb
Copy link

segersb commented Nov 10, 2015

When selecting items from the autofill menu in safari on an input field, the ng-model does not seem to update. When looking at the shadow DOM the autofill value is present though.

To enable the autofill the input tag must have an ID.
Tested on OXS 10.11.1 (El Capitan) - Safari 9.0.1 - Angular 1.4.7
http://jsfiddle.net/ro2je6ej/

Note the spell checker does seem to work.

bug

@Narretz
Copy link
Contributor

Narretz commented Nov 13, 2015

Did this work in previous version of Safari? This is usually a sign of the browser not firing the change / input event in that specifc case. Can you test if a plain change / input listener is fired?

@segersb
Copy link
Author

segersb commented Nov 14, 2015

I'm not sure if it worked in previous versions of Safari.
The plain onChange / onInput events are NOT being fired when using the autocomplete. However the onKeyUp and onBlur are bering fired correctly.

I tried using ng-model-options="{ updateOn: 'blur' }" in my example above but it didn't work.

@Narretz
Copy link
Contributor

Narretz commented Nov 16, 2015

Looks like a bug in Webkit to me. Can you open a bug report?

@bharatn
Copy link

bharatn commented Nov 17, 2015

See if this helps - https://github.com/tbosch/autofill-event

@tenxliviu
Copy link

tenxliviu commented Apr 25, 2016

+1

https://github.com/tbosch/autofill-event works, but this should be fixed in angular, not using a 3rd party from 2014

@karptonite
Copy link

This appears to still be in an issue; it is tagged as needs more info--what additional info is needed?

@Narretz Narretz changed the title Safari autofill not updating model Safari autocomplete not updating model Jun 23, 2016
@Narretz
Copy link
Contributor

Narretz commented Jun 23, 2016

This is a known issue, and atm Safari refuses to fire an event on a normal autocomplete. This also affects other libraries: facebook/react#1159
Previously we decided not to change core for this fix, because we hoped that browser vendors would fix this: #1460 (comment)
There's also no need to have a specific angular solution, as this affects other libs too.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

5 participants