Skip to content

Commit

Permalink
Fix submitHandler over triggering (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
GioSensation authored Mar 25, 2022
1 parent 81ea87a commit 42202c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dist/autofill.js
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,9 @@ module.exports={
"zdf.de": {
"password-rules": "minlength: 8; required: upper; required: digit; allowed: lower, special;"
},
"zara.com": {
"password-rules": "minlength: 8; required: lower; required: upper; required: digit;"
},
"zoom.us": {
"password-rules": "minlength: 8; maxlength: 32; max-consecutive: 6; required: lower; required: upper; required: digit;"
}
Expand Down Expand Up @@ -5673,7 +5676,7 @@ const listenForGlobalFormSubmission = () => {
});
const observer = new PerformanceObserver(list => {
const entries = list.getEntries().filter(entry => // @ts-ignore why does TS not know about `entry.initiatorType`?
['fetch', 'xmlhttprequest'].includes(entry.initiatorType) && entry.name.match(/login|sign-in|signin|session/));
['fetch', 'xmlhttprequest'].includes(entry.initiatorType) && entry.name.match(/login|sign-in|signin/));
if (!entries.length) return;
const filledForm = [...forms.values()].find(form => form.hasValues());
filledForm === null || filledForm === void 0 ? void 0 : filledForm.submitHandler();
Expand Down
3 changes: 3 additions & 0 deletions packages/password/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,9 @@
"zdf.de": {
"password-rules": "minlength: 8; required: upper; required: digit; allowed: lower, special;"
},
"zara.com": {
"password-rules": "minlength: 8; required: lower; required: upper; required: digit;"
},
"zoom.us": {
"password-rules": "minlength: 8; maxlength: 32; max-consecutive: 6; required: lower; required: upper; required: digit;"
}
Expand Down
2 changes: 1 addition & 1 deletion src/Form/listenForFormSubmission.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const listenForGlobalFormSubmission = () => {
const entries = list.getEntries().filter((entry) =>
// @ts-ignore why does TS not know about `entry.initiatorType`?
['fetch', 'xmlhttprequest'].includes(entry.initiatorType) &&
entry.name.match(/login|sign-in|signin|session/)
entry.name.match(/login|sign-in|signin/)
)

if (!entries.length) return
Expand Down

0 comments on commit 42202c4

Please sign in to comment.