tbosch / autofill-event

A polyfill to fire a change event when the browser auto fills form fields
MIT License
383 stars 53 forks source link

Firefox: Auto fill does not trigger on view changed #7

Closed gaoht closed 10 years ago

gaoht commented 10 years ago

My Firefox version: 26.0 This is my test sample: http://plnkr.co/edit/wZHXw4PCWolrDoTMw8nZ?p=preview

I copied the autofill-event.js to the plunkr for test.

There are 2 errors:

Is anything wrong in my code?

tbosch commented 10 years ago

Hi, sorry for the late answer. Yes, calling $rootElement.find('input').checkAndTriggerAutoFillEvent() manually should auto fill the values, if the view is connected to the root element.

Will try to reproduce this and then come back to you.

tbosch commented 10 years ago

Hi, here is an updated plunker: http://plnkr.co/edit/AWSlgcPHMFVCMxhuajDo?p=preview

Just need to wait a little bit before calling changeAndTriggerAutoFillEvent() (I used 200ms in the example).

Ok, I see the problem now. This polyfill should automatically call changeAndTriggerAutoFillEvent if Angular is present and we are doing view changes.

Would you like to try a PR for this?

gaoht commented 10 years ago

@tbosch, Thanks very much, that works now.