Skip to content

Commit

Permalink
style: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
dbajpeyi committed Jul 16, 2024
1 parent 6f19720 commit 5fb9d91
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 34 deletions.
10 changes: 3 additions & 7 deletions dist/autofill-debug.js

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

10 changes: 3 additions & 7 deletions dist/autofill.js

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

3 changes: 1 addition & 2 deletions src/Scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ class DefaultScanner {
inputs.forEach((input) => this.addInput(input))
if (context instanceof HTMLFormElement && this.forms.get(context)?.hasShadowInput) {
const selector = this.matching.cssSelector('formInputsSelectorWithoutSelect')
const shadowElements = findEnclosedElements(context, selector)
shadowElements.forEach((input) => {
findEnclosedElements(context, selector).forEach((input) => {
if (input instanceof HTMLInputElement) {
this.addInput(input, context)
}
Expand Down
6 changes: 2 additions & 4 deletions src/autofill-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,12 @@ function getActiveElement (root = document) {
* Takes a form element, creates a treewalker and finds all shadow elements that match the selector
* @param {HTMLElement|HTMLFormElement} root
* @param {string} selector
* @returns {HTMLElement[]}
* @returns {Element[]}
*/
function findEnclosedElements (root, selector) {
// Check if there are any normal elements that match the selector
const elements = root.querySelectorAll(selector)
const elements = [...root.querySelectorAll(selector)]
if (elements.length > 0) {
/** @ts-ignore */
return elements
}

Expand All @@ -592,7 +591,6 @@ function findEnclosedElements (root, selector) {
node = walker.nextNode()
}

/** @ts-ignore */
return shadowElements
}

Expand Down
10 changes: 3 additions & 7 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.

10 changes: 3 additions & 7 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 5fb9d91

Please sign in to comment.