Skip to content

Commit

Permalink
Fix form submission overtriggering (#324)
Browse files Browse the repository at this point in the history
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
  • Loading branch information
GioSensation committed May 26, 2023
1 parent 084ba7b commit d1558f7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dist/autofill-debug.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/autofill.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/DeviceInterface/initFormSubmissionsApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ export function initFormSubmissionsApi (forms) {
if (!entries.length) return

const filledForm = [...forms.values()].find(form => form.hasValues())
const focusedForm = [...forms.values()].find((form) => form.hasFocus())
// If a form is still focused the user is still typing: do nothing
if (focusedForm) return

filledForm?.submitHandler('performance observer')
})
observer.observe({entryTypes: ['resource']})
Expand Down
3 changes: 3 additions & 0 deletions swift-package/Resources/assets/autofill-debug.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions swift-package/Resources/assets/autofill.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d1558f7

Please sign in to comment.