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

fix(autocomplete-valid): allow type=tel for appropriate cc types #2575

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions lib/checks/forms/autocomplete-appropriate-evaluate.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ function autocompleteAppropriateEvaluate(node, options, virtualNode) {
return true;
}

const number = ['text', 'search', 'number'];
const number = ['text', 'search', 'number', 'tel'];
const url = ['text', 'search', 'url'];
const allowedTypesMap = {
bday: ['text', 'search', 'date'],
email: ['text', 'search', 'email'],
'cc-exp': ['text', 'search', 'month'],
'street-address': ['text'], // Issue: https://github.com/dequelabs/axe-core/issues/1161
tel: ['text', 'search', 'tel'],
'tel-country-code': ['text', 'search', 'tel'],
Expand All @@ -22,8 +21,11 @@ function autocompleteAppropriateEvaluate(node, options, virtualNode) {
'tel-local-prefix': ['text', 'search', 'tel'],
'tel-local-suffix': ['text', 'search', 'tel'],
'tel-extension': ['text', 'search', 'tel'],
'cc-number': number,
'cc-exp': ['text', 'search', 'month', 'tel'],
'cc-exp-month': number,
'cc-exp-year': number,
'cc-csc': number,
'transaction-amount': number,
'bday-day': number,
'bday-month': number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,9 @@
<input autocomplete="street-address" id="fail6" type="file" />
<input autocomplete="bday-month" type="month" id="fail7" />
<input type="NUMBER" autocomplete="email" id="fail8" />

<input autocomplete="cc-number" type="tel" id="pass78" />
<input autocomplete="cc-exp" type="tel" id="pass79" />
<input autocomplete="cc-exp-month" type="tel" id="pass80" />
<input autocomplete="cc-exp-year" type="tel" id="pass81" />
<input autocomplete="cc-csc" type="tel" id="pass82" />
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@
["#pass74"],
["#pass75"],
["#pass76"],
["#pass77"]
["#pass77"],
["#pass78"],
["#pass79"],
["#pass80"],
["#pass81"],
["#pass82"]
]
}