-
Notifications
You must be signed in to change notification settings - Fork 4.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
Replace RovingTabIndex with reakit composite #22489
Conversation
Size Change: -525 B (0%) Total Size: 1.12 MB
ℹ️ View Unchanged
|
b462d7d
to
6a42d58
Compare
There are some difficult challenges here. The block navigation has now evolved to have both
|
…reeGridCell and a TreeGridItem
6a42d58
to
1f474d3
Compare
Is there an issue I can check to learn more about that change on the block navigation?
The WAI-ARIA Authoring Practices has a section about this: https://www.w3.org/TR/wai-aria-practices/#gridNav_inside. But this is really tricky indeed. For dropdowns, I think it's easier to just disable the arrow down key on them like on this example: https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html#ex2_label |
By the way, |
@diegohaz Thanks for your feedback so far, that's been really helpful. I think I'm going to park this PR for the time being as the Block Navigation UI is in some pretty rapid development at the moment and I can't keep up 😄 One thing I did spot, and I wasn't sure whether it was an issue with this PR or something upstream with Reakit, is that when re-ordering rows in the table (e.g. when moving blocks), the keyboard navigation order became incorrect. It felt like there might be a cached version of the expected order of elements held internally. For example if I have blocks A, B, and C, arrowing through the rows works as expected, but then reordering to A, C, B, keyboard navigation would go from A to B to C still. |
Oh, good catch! I haven't looked into it yet, but I'm pretty sure that's a limitation on Reakit. For performance reasons, I'll make sure this is supported in the next version. |
Description
Follow up to #19799, related to #22373, see comment thread #19799 (comment) for further info.
Replaces the internally used
RovingTabIndex
component with theComposite
component from Reakit library.Composite
is already used by another component to implement a grid, so it seems like a good opportunity to consolidate and rely on the more robust implementation of a library.Props to @diegohaz for the work on Reakit and the example that this is based on:
https://codesandbox.io/s/reakit-composite-treegrid-sh6uu?file=/src/TreeGrid.js
How has this been tested?
Screenshots
Types of changes
Non-breaking refactor
Checklist: