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

[Credentials] Autofill when elements are in shadow #592

Merged
merged 22 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: update comments
  • Loading branch information
dbajpeyi committed Jul 19, 2024
commit a01ca2f5c952dd607857a25fb15ac660b984ed5a
4 changes: 2 additions & 2 deletions dist/autofill-debug.js

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

4 changes: 2 additions & 2 deletions dist/autofill.js

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

2 changes: 1 addition & 1 deletion src/Form/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ class Form {
// For form elements we use .elements to catch fields outside the form itself using the form attribute.
// It also catches all elements when the markup is broken.
// We use .filter to avoid fieldset, button, textarea etc.
const formElements = [...this.form.elements].filter((el) => el.matches(selector))
// If there are not form elements, we try to look for all
// enclosed elements within the form.
const formElements = [...this.form.elements].filter((el) => el.matches(selector))
foundInputs = formElements.length > 0
? formElements
: findEnclosedElements(this.form, selector)
Expand Down
2 changes: 1 addition & 1 deletion src/autofill-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ function getActiveElement (root = document) {
}

/**
* Takes a root element, creates a treewalker and finds all shadow elements that match the selector
* Takes a root element and tries to find visible elements first, and if it fails, it tries to find shadow elements
* @param {HTMLElement|HTMLFormElement} root
* @param {string} selector
* @returns {Element[]}
Expand Down
4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 deletions swift-package/Resources/assets/autofill.js

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

Loading