Skip to content

Commit

Permalink
autocomplete enhancement fixes (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
chikara1608 authored Jan 28, 2025
1 parent ab7f795 commit 5370d4c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/rules/autocomplete-a11y-matches.js
Original file line number Diff line number Diff line change
@@ -92,6 +92,14 @@ function quantityField(node) {
});
}

function isReadOnly(node) {
return node.hasAttribute('readonly');
}

function isCombobox(node) {
return node.getAttribute('role') === 'combobox';
}

function autocompleteA11yMatches(node, virtualNode) {
const a11yEngineFlag = true;
/* the flag is used to tell autocomplete matcher that it is being called
@@ -100,7 +108,9 @@ function autocompleteA11yMatches(node, virtualNode) {
return (
autocompleteMatches(node, virtualNode, a11yEngineFlag) &&
!nodeIsASearchFunctionality(node) &&
!quantityField(node)
!quantityField(node) &&
!isReadOnly(node) &&
!isCombobox(node)
);
}

0 comments on commit 5370d4c

Please sign in to comment.