Skip to content

Commit 22740b4

Browse files
committed
Bug fix chrome-off
1 parent bb4338c commit 22740b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/checks/forms/autocomplete-a11y-evaluate.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { isValidAutocomplete } from "../../commons/text";
33
function checkIsElementValidAutocomplete(node, options, virtualNode) {
44
const autocomplete = virtualNode.attr('autocomplete')?.toLowerCase().trim();
55
// if element has autocomplete attribute as off then it is not a violation
6-
if(autocomplete === "off") {
6+
if(autocomplete === "off" || autocomplete==="chrome-off") {
77
return true;
88
}
99

@@ -33,7 +33,8 @@ function checkIsElementValidAutocomplete(node, options, virtualNode) {
3333
const closestForm = virtualNode.actualNode.closest("form");
3434

3535
//if it exists inside the form and autocomplete for form is off
36-
if(closestForm && closestForm.getAttribute('autocomplete')?.toLowerCase().trim() === "off") {
36+
if(closestForm && (closestForm.getAttribute('autocomplete')?.toLowerCase().trim() === "off"
37+
|| closestForm.getAttribute('autocomplete')?.toLowerCase().trim() === "chrome-off")) {
3738
// if autocomplete attribute is not present for element then its a pass in this scenario
3839
// otherwise check all posibilities with the method
3940
return autocomplete ? checkIsElementValidAutocomplete(node, options, virtualNode) : true;

0 commit comments

Comments
 (0)