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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/core.js
Expand Up @@ -54,11 +54,11 @@ $.extend( $.fn, {
var hidden, result;

// Insert a hidden input as a replacement for the missing submit button
// The hidden input is inserted in two cases:
// The hidden input is inserted when user doesn't define `disableHiddenInput` as true and one of these two cases are fulfilled:
// - 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 ) {
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

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

.attr( "name", validator.submitButton.name )
.val( $( validator.submitButton ).val() )
Expand Down Expand Up @@ -261,6 +261,7 @@ $.extend( $.validator, {
validClass: "valid",
errorElement: "label",
focusCleanup: false,
disableHiddenInput: false,
focusInvalid: true,
errorContainer: $( [] ),
errorLabelContainer: $( [] ),
Expand Down