Improve sortable list accessibility and remove drag-and-drop code#1813
Improve sortable list accessibility and remove drag-and-drop code#1813
Conversation
732b46f to
7e271f3
Compare
ksierks
left a comment
There was a problem hiding this comment.
I was able to test the sortable lists through line list export, but the previews did not work for me.
Thanks for finding that, fixed in 580f169 |
|
Unless this changed, I believe we made the explicit decision to make the disabled buttons focusable since W3C's listbox components' disabled buttons are focusable/tabbable |
Yeah using |
…r better accessibility
580f169 to
c4ab10e
Compare
Sounds good, sorry @ChrisHuynh333 and @ericenns updated in e3bca2d |
This reverts commit caab554.
What does this PR do and why?
This updates sortable list interactions so keyboard and screen reader users can move, select, and reorder options with clearer focus feedback. It also removes old drag-and-drop grouping code that is no longer used, which makes the component simpler and less error-prone.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other pull requests.
How to set up and validate locally
bin/dev.http://localhost:3000/rails/view_components/sortable_lists_component_preview/two_listsand verify you can move focus withTab, move between options withArrow UpandArrow Down, toggle selection withSpace, add withEnter, remove withDelete, and reorder selected options withAlt+Arrow UpandAlt+Arrow Down.http://localhost:3000/rails/view_components/sortable_lists_component_preview/three_listsand verify list items are not draggable with the mouse, list behavior still works through buttons and keyboard, and no JavaScript errors appear in the browser console.PR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.