[Autocomplete] Fix aria-controls and aria-activedescendant#18142
[Autocomplete] Fix aria-controls and aria-activedescendant#18142eps1lon merged 4 commits intomui:masterfrom
Conversation
|
|
||
| fireEvent.keyDown(document.activeElement, { key: 'Escape' }); | ||
|
|
||
| expect(handleClose.callCount).to.equal(1); |
There was a problem hiding this comment.
This will be called twice with jsdom actual because the implementation includes a .focus() noop that causes jsdom to fire a blur event which also calls onClose. In the browser this will work correctly.
0efec53 to
24b80cb
Compare
Details of bundle changes.Comparing: 13b3a0d...24b80cb
|
oliviertassinari
left a comment
There was a problem hiding this comment.
So cool to have these new tests :)
| getListboxProps: () => ({ | ||
| role: 'listbox', | ||
| id: `${id}-listbox`, | ||
| id: `${id}-popup`, |
There was a problem hiding this comment.
If the role of this element is listbox, should we suffix the id with -listbox?
There was a problem hiding this comment.
The popup is the generic term for the "list" of possible items. It can also be a grid or tree. It makes more sense if you look at the aria-controls which doesn't care if you have a listbox or grid or tree. Just that the element in question is the popup with the possible items.
There was a problem hiding this comment.
This seems correct, oops 🙃. What do you think of killing the getPopupProps() method and renaming PopupComponent to PopperComponent? (for future changes)
There was a problem hiding this comment.
I thought that the popup was a different element to the listbox. As you raised it out, it's not. Because the default value for PopupComponent is a Popper, the change could make the API more intuitive.
I'm splitting work into smaller chunks starting with closing #18132
Tests https://www.w3.org/TR/wai-aria-1.1/#combobox except accessible name computation and keyboard navigation.
I'll remove the
jsdompatch once this gets approved. It's easier to see that this is an issue with jsdom not our implementation