-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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] Remove aria-activedescendant #18281
[Autocomplete] Remove aria-activedescendant #18281
Conversation
Details of bundle changes.Comparing: 3d393bf...a43eb78
|
@@ -86,13 +86,6 @@ export default function useAutocomplete(props) { | |||
setDefaultId(`mui-autocomplete-${Math.round(Math.random() * 1e5)}`); | |||
}, []); | |||
|
|||
const popperRef = React.useRef(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.
dead code
@@ -234,7 +256,7 @@ describe('<Autocomplete />', () => { | |||
it('moves focus to the last option on ArrowUp', () => { | |||
const { getAllByRole, getByRole } = render( | |||
<Autocomplete | |||
options={['one', 'two ']} | |||
options={['one', 'two']} |
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.
normalize the options in this test file
@@ -680,7 +673,7 @@ export default function useAutocomplete(props) { | |||
onChange: handleInputChange, | |||
// if open then this is handled imperativeley so don't let react override | |||
// only have an opinion about this when closed | |||
'aria-activedescendant': popupOpen ? undefined : null, | |||
'aria-activedescendant': popupOpen ? '' : 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.
I haven't looked in detail how React handles undefined vs null. One key element is that, as far as I know, React doesn't diff with the DOM, but with the preview tree representation, he has. I suspect treats both values the same way, hence doesn't apply a diff. In any case, our test cases are our belt and straps.
9b4a2f0
to
a43eb78
Compare
Closes #18133