silverstripe-elemental: SPIKE: Keyboard accessible reordering of blocks
It is currently not possible on master
to re-order blocks on a page with keyboard actions. We should investigate the best way to implement functionality that provides keyboard access to reordering functionality.
Drag and drop will be implemented via #285 but https://github.com/react-dnd/react-dnd
doesn’t provide accessible functionality out of the box.
Ideas (in likely priority)
~1. Ensure inline adding of blocks can be tabbed to:~ split to #627
2. Investigate if accessibility can be built on top of
react-dnd/react-dnd
3. Investigate recent accessibility improvements in https://github.com/atlassian/react-beautiful-dnd
although additional development will be expected.
4. Look into a ‘move block up/down’ function to +1/-1 the order of the block on the page
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (15 by maintainers)
Sorry, I wasn’t trying to suggest that it would be simple, but rather that we should weigh up the effort versus reward. Here’s where I see the options for this issue now:
Option 1: replace react-dnd with react-beautiful-dnd
React with 🎉 to vote for option 1
Pros:
Cons:
Option 2: keep react-dnd and implement out own keyboard accessibility events
React with ❤️ to vote for option 2
Pros:
Cons:
Option 3: add new options to the more actions menu to move elements
React with 🚀 to vote for option 3
Example:
Pros:
Cons:
Option 4: add tab key accessible “up” and “down” options
in the blue “add new element” barsomewhere on the element headerReact with 👀 to vote for option 4
Example:
(Except use icons instead of text)
Pros:
Cons:
Same as option 3 (minus the menu bloat)@silverstripe/creative-commoners please vote on this so we can agree on the way forward, and then close this spike =) cc @silverstripeux
My suggestion would be to make an area near the drag icon tab-able with the arrow icon actions to move the item up or down. The drag handle would help to provide context as to what the actions do. The options dropdown is going to get overloaded with more actions soon or through a project’s development (duplicate, move, other tabs).
I voted ❤️ 🚀 and 👀 . I think that ❤️ is a bit of a pipe-dream but I like the idea of doing both 🚀 and 👀 . I even think 🚀 will be minimal effort.
Don’t think this requires designs, react-beautiful-dnd seems to have built-in drag-n drop for screen readers. https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/screen-reader.md