-
-
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
[MenuList] Ignore disableListWrap for text focus navigation #15555
Conversation
* Attempt to verify focusVisible
Details of bundle changes.Comparing: 1ee592a...cd6c90b
|
To quickly summarize this for me: Do we wrap or not? Because not wrapping is only a mac feature. Windows and linux wrap when navigating through items in a list. The WAI-ARIA authoring practices also recommend wrapping. Mac is the clear outlier here and we shouldn't match their behavior. |
@eps1lon 👍, there is a precedent for ignoring MacOS behavior on this select component: |
@eps1lon Before this change, if Far as I can tell, this is the behavior for |
That's not matching the WAI-ARIA recommendations: Open the listbox and press "f" repeatedly. It will stop at the last item and not wrap. |
Maybe the question is if our Select is actually implementing the listbox pattern. |
@eps1lon Where is this quote from. This doesn't seem to be in sync with the behavior here: https://www.w3.org/TR/wai-aria-practices/examples/listbox/listbox-collapsible.html. In their example arrow keys don't wrap, but text matching does. |
That was github not properly formatting my comment. This was the behavior I observed. The issue was that wrapping is debounced. Press is semi-quickly and it won't work. You need to explicitly pause. Not sure if it is just laggy or intended. |
Oh now I understand it. It buffers the input:
|
My implementation is modeled off of the browser |
I think the WAI-ARIA example works similarly but I find it pretty unintuitive since the buffer is invisible. Thanks for clearing this up. |
The WAI-ARIA example seems to always honor the full buffer, so you can’t do fast repeated characters. Instead you have to wait for a buffer reset after each key in order for repeated characters to advance to the next one. |
Addresses issues noted here.
Native
select
behavior wraps the navigation when doing text matching but not for arrow keys, so the text matching now ignores thedisableListWrap
property.This makes an attempt to regression test focus-visible logic for
MenuList
, however it is difficult to do this robustly since thesimulate
function does not bubble events up the same way as dispatchEvent, so events never reach the document event listeners set up byfocusVisible.js
. I added a couple usages ofdispatchEvent
to cause changes tohadKeyboardEvent
infocusVisible.js
and verified that the focus visible class gets added or not appropriately after focus change.