-
Notifications
You must be signed in to change notification settings - Fork 309
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
Keyboard accessiblity improvements #598
Comments
Hey, thank you very much for the detailed proposal. I didn't have the time to read it through yet but will try in the coming days. Thanks for your patience. |
No problem! In the meantime, I've tried to implement some stuff on my own, but that made me stumble into some implementation details where I don't understand enough of the context to follow up with it or take decisions that could break the implementation. I'm leaving this here so in the future they can be clarified and also as possible know-ahead for implementing this feature 😄 I've had to manually invoke I've also had a hard time trying to figure out how event listeners were delegated to add a global Hope we can find a solution in the future and I'll see if I can progress further ahead with my testing. |
Hi @royeden, finally had the chance to look at this. Thanks for your time on this. Here's a sandbox that we could iterate on:
Unfortunately there's not a lot we can do about this (and it's specific to the simple example sandbox using Handling focusI really don't think the lib should be opinionated about handling focus. Focus universally works with the
That could be interesting indeed, and relatively easy to implement. |
Hi @dbismut , thank you for responding! I believe that adding an option to debounce the keyup handler and leave it to the user to config the debounce time seems like a good fix for the issue in the meantime. I would really like to see a fix in the future that standardizes more with other libraries/people using keyboard drag gestures (with the enabled / disabled state), so a drag and drop library can be implemented with this library under the hood 😄 Leaving this post as a reference of what I mean with the enabled / disabled interactions to handle movement: https://medium.com/salesforce-ux/4-major-patterns-for-accessible-drag-and-drop-1d43f64ebf09 |
Thanks for the link, interesting read. I think we should discuss this on Discord to make this more fluent. Can you add me there? |
Joined the pmndrs discord, I'll send the message on the corresponding channel when I'm available! |
Describe the bug
Relevant examples from other dnd libraries:
react-dnd-kit
implements gesture-like API.react-beautiful-dnd
is more focused on having specific list containers where the objects end in, so they end up behaving more like a FLIP animation.svelte-dnd-action
behaves similarly toreact-beautiful-dnd
.Possible naive fix:
It could be good togo with the dnd-kit approach, where the gesture has to be activated with
Enter
orSpacebar
before moving when you are using the keyboard (This is also used in other libraries likesvelte-dnd-action
andreact-beautiful-dnd
, so it seems like the common / intuitive behavior). This would imply thinking about the following caveats:Enter
/Spacebar
on the element? Should a click handler be fired on the element if its natively supported (like withbutton
ora
)?tabindex
).blur
events on the element? They should end the drag gesture. Should ablur
event handler be placed during the binding? Or should it track globally with a system based on event delegation?I believe that issues 1 and 2 could be achieved with the current engine, by swapping out the requirements for the gesture to be active, but 3 might require a bit more thinking.
Let me know if this issue and overview is useful, I would like to try my hand at implementing this feature because I'm looking for a framework agnostic solution to build some DND actions 😄
A possible relevant discussion regarding this issue on this repo
Sandbox or Video
Code:
Information:
Checklist:
touch-action: none
to the draggable element.The text was updated successfully, but these errors were encountered: