fix: only add aria-activedescendant when menu is open#926
fix: only add aria-activedescendant when menu is open#926stefanprobst wants to merge 4 commits intodownshift-js:masterfrom
Conversation
silviuaavram
left a comment
There was a problem hiding this comment.
Also run npm run validate and commit the .size-snapshot please. Thank you!
| ) | ||
|
|
||
| fireEvent.click(toggleButton) | ||
| // fireEvent.blur(input) |
There was a problem hiding this comment.
sure -- comment was just for symmetry with the comments above
There was a problem hiding this comment.
I mean also the line below, I don't see why is it needed.
There was a problem hiding this comment.
the input.blur() is needed actually (or toggleButton.focus() alternatively). i had assumed it was just an oversight this test did not have that line while e.g. the one above did.
without manually blurring/focusing the actions fire in wrong order:
without manual blur:
__togglebutton_click____togglebutton_click____togglebutton_click____input_blur__
with:
__togglebutton_click____togglebutton_click____input_blur____togglebutton_click__
|
As I merged a big change as part of v5 I re-created this PR. Ran the tests without the |
What: in
useSelect/useComboboxonly addaria-activedescendantattribute when menu is open to avoid pointing to non-existing id.Why: Fixes #921
How: check if
isOpenistruebefore addingaria-activedescendant.Checklist: