-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[Autocomplete] Fix the errors reported by Wave #18283
Conversation
Details of bundle changes.Comparing: 3d393bf...42aa823
|
|
||
.token.boolean, | ||
.token.number { | ||
color: #b78eff; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reach AA contrast level. The problem is more visible since the introduction of code previews.
@@ -46,6 +46,7 @@ export default function Asynchronous() { | |||
|
|||
return ( | |||
<Autocomplete | |||
id="asynchronous-demo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix id duplication, server-side as reported by https://validator.w3.org/.
@@ -310,6 +313,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) { | |||
<IconButton | |||
{...getPopupIndicatorProps()} | |||
disabled={disabled} | |||
aria-label={popupOpen ? 'Close popup' : 'Open popup'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix a Wave error, not all the screen readers handle title.
@@ -671,6 +671,7 @@ export default function useAutocomplete(props) { | |||
}), | |||
getInputLabelProps: () => ({ | |||
id: `${id}-label`, | |||
htmlFor: id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case somebody doesn't use our TextField.
ref: inputRef, | ||
autoCorrect: 'off', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid HTML attribute and seems legacy for older versions of Safari. I'm eager to try without.
'aria-controls': `${id}-popup`, | ||
// autoComplete: 'off', // Disable browser's suggestion that might overlap with the popup. | ||
autoComplete: 'disabled', // disable autocomplete and autofill | ||
'aria-controls': popupOpen ? `${id}-popup` : null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix https://validator.w3.org/ error were aria-controls points to a missing element.
@@ -287,6 +288,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) { | |||
> | |||
{renderInput({ | |||
ref: setAnchorEl, | |||
id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used by TextField to link the helper text, input, and label together. Error reported by Wave and https://validator.w3.org/.
59ddd6b
to
42aa823
Compare
Closes #18132
Solve most of the errors reported by Wave and https://validator.w3.org/.