Skip to content
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

component: Chrome autofill bugfix #2230

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

szmagli
Copy link

@szmagli szmagli commented Oct 25, 2018

resolve #2228

Description

Thank you!

@staabm
Copy link
Member

staabm commented Oct 25, 2018

Could you elaborate a bit why this change fixes your problem?

The newly added config key is rather cryptic named, I dont know what it does...?

Why do we need this new config flag after alll?

@szmagli
Copy link
Author

szmagli commented Oct 25, 2018

Any form element (button, input etc.) inserted by javascript trigger chrome autofill.
I should rename config option to disableSubmitButton.
This should be a new flag becouse this options is required for 'remote' function.

@@ -58,7 +58,7 @@ $.extend( $.fn, {
// - A user defined a `submitHandler`
// - There was a pending request due to `remote` method and `stopRequest()`
// was called to submit the form in case it's valid
if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) && !validator.settings.disableSubmitSec ) {
if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) && !validator.settings.disableHiddenInput ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment above is now outdated.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment changed

@staabm
Copy link
Member

staabm commented Oct 25, 2018

as I read the comment in the source, I am wondering, why you use a form without a explicit submit button?

@szmagli
Copy link
Author

szmagli commented Oct 25, 2018

Any variation of form doesn't work (even from example files).

If i doesn't disable this option by disableHiddenInput this hidden input is created.
I always use submitHandler to process data after validation and validator.submitButton always is true

@staabm
Copy link
Member

staabm commented Oct 25, 2018

hmm not sure this solution is a good fit. @Arkni any opinions/ideas on this?

@szmagli
Copy link
Author

szmagli commented Oct 25, 2018

I'm also not sure about this solution. When someone change password and doesn't confirm this to chrome when he try to login injecting any button, input etc. restore form fields. I need find way to fix this, not skip.

Why incjecting input is required when user define submitHandler?

There was a pending request due to remote method and stopRequest()

This can't be replaced by attribute or store in variable?

@Arkni
Copy link
Member

Arkni commented Oct 26, 2018

Hi @szmagli,

I can't test it right now, but could setting autocomplete to "off" (or to a random string) on the hidden input stop the browser from auto filling the other fields?

@szmagli
Copy link
Author

szmagli commented Oct 27, 2018

@Arkni i tried but onload aoutocomplete should be on, before i call validation i try to change to off, password field to autocolplete="new-password" but chrome ignore that.

// - A user defined a `submitHandler`
// - There was a pending request due to `remote` method and `stopRequest()`
// was called to submit the form in case it's valid
if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) ) {
if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) && !validator.settings.disableHiddenInput ) {
hidden = $( "<input type='hidden'/>" )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arknis idea was to add autocomplete off to this input which is beeing injected

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't work neither

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

Successfully merging this pull request may close these issues.

Chrome - saved password restored after submitHandler.
3 participants