New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form validation status not updated when using js-based password managers to fill password fields #3133

Closed
marenaud opened this Issue Jul 4, 2013 · 6 comments

Comments

Projects
None yet
5 participants
@marenaud

marenaud commented Jul 4, 2013

Using angularjs v1.1.5. I have an (input type="password" required ng-minlength="6") inside a form, and a button that is disabled unless the form is valid (button ng-disabled="!signupform.$valid" type="submit"). When a password is filled in using javascript password managers (tested using https://chrome.google.com/webstore/detail/enigmapass/bgkipgfgpifliinhbnfoaafgdeemodoi?hl=en), the form validation state is not updated (button is still disabled) until the user inputs more characters in the password box, even if the password is minlength 6 characters.

@jtymes

This comment has been minimized.

Contributor

jtymes commented Jul 9, 2013

Check out the discussion over at #1460. It's a big pain for a lot of people, but it's hard to solve.

@jxpx777

This comment has been minimized.

jxpx777 commented Jul 16, 2013

I can see where autocomplete would be a hard problem to solve. I'm adding my input here because password managers work a little different (less naively IMHO) than browsers' autofill functionality. I work on 1Password and we're receiving some reports of this ourselves. What's different for us is that we actually simulate events after setting the value so that the validation observers should be triggered. Specifically, before we fill the data, we focus the element, fire simulated events using createEvent, initKeyboardEvent, of initKeyEvent for keydown, keyup, and keypress (in that order). Then we set the value. Then, we fire another set of events for after setting the value. Again, keydown, keyup, keypress, change, and then blur, in that order. By my calculation, one of these post value setting events should trigger AngularJS validations, but it doesn't. Would love some ideas about how we can help our users have a great experience when filling AngularJS forms.

@pkozlowski-opensource

This comment has been minimized.

Member

pkozlowski-opensource commented Jul 16, 2013

@jxpx777 The current implementation of AngularJS listens to the input event on browsers that support it and has a fallback strategy for ones that don't. Relevant piece of the code here:
https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L413

I can't see the input event listed in your description so this might be why it doesn't work with your setup.

@jxpx777

This comment has been minimized.

jxpx777 commented Jul 16, 2013

@pkozlowski-opensource That was it exactly! I just pushed a fix that includes the input event, so 1Password users should have a better experience starting with the next release. Thanks for your quick reply!

@pkozlowski-opensource

This comment has been minimized.

Member

pkozlowski-opensource commented Jul 21, 2013

@loarake I'm not sure what we could do in AngularJS about it... AngularJS listens to DOM events to detect input changes and update model accordingly.

I guess you should contact your favorite password manager vendor to emit one of the input events as discussed with @jxpx777 . Closing for now, feel free to re-open if you've got any further elements.

@skorokithakis

This comment has been minimized.

skorokithakis commented Jul 24, 2013

Can't Angular add listeners for the other events @jxpx777 mentioned? There will be some applications that will be using the same technique, and that would fix it for them, rather than wait for every single one to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment