Skip to content

Commit

Permalink
fix: check if parent for is the same as the real target
Browse files Browse the repository at this point in the history
  • Loading branch information
dbajpeyi committed Nov 22, 2024
1 parent 886809e commit 98f5c60
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/Scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,10 @@ class DefaultScanner {
// find the enclosing parent form, and scan it.
if (realTarget instanceof HTMLInputElement && !realTarget.hasAttribute(ATTR_INPUT_TYPE)) {
const parentForm = this.getParentForm(realTarget);

// If the parent form is an input element, we don't want to scan it further
if (parentForm instanceof HTMLInputElement) return;

const hasShadowTree = event.target?.shadowRoot != null;
const form = new Form(parentForm, realTarget, this.device, this.matching, this.shouldAutoprompt, hasShadowTree);
this.forms.set(parentForm, form);
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 98f5c60

Please sign in to comment.