Polyfill to work around browser auto-complete forms

    A year ago, issue # 1460 “Form model doesn't update on autocomplete” was created in the AngularJS repository .

    The browser, when autofilling the form with previously saved data (for example, enter email - the browser fills in the password automatically) does not notify javascript of the new data in the field.

    During the existence of this problem, various crutches were written, which can be evaluated in the comments on the issue. Now an official crutch has appeared. And while browser developers are not paying attention to the problem, this is the best solution - Autofill event polyfill .

    Will have to connect another script. The principle of operation is as follows - according to “DOMContentLoaded” the script runs through the fields and remembers their current value, after a timeout of 200 milliseconds, compares the previously saved value with the current one, if they differ, the “change” event is raised for the field. By the “blur” event for one of the fields, the check starts again.

    Links:
    Autofill event polyfill
    issue # 1460

    Also popular now: