-
Notifications
You must be signed in to change notification settings - Fork 109
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
Don't add tab index to empty drop zones #245
base: master
Are you sure you want to change the base?
Don't add tab index to empty drop zones #245
Conversation
Okay, never-mind, this breaks accessibility. Do you have any thoughts on how to handle the empty-list problem, though? |
I updated the PR to set tabindex to -1 when there are no items in the drag zone. |
Hi @danny-andrews , I've been thinking for awhile that we probably need to allow to override the tabindex that is set by the library but it's not fully formed in my mind. |
Not a problem. Yeah, that's a fair point. I wonder if we could do away with adding a tabindex to the dragzone altogether and add |
Maybe...
Can experiment with it when i have some time or you are super welcome to try
…On Sat, Feb 13, 2021, 09:48 Danny Andrews ***@***.***> wrote:
Not a problem.
Yeah, that's a fair point. I wonder if we could do away with adding a
tabindex to the dragzone altogether and add aria-describedby to each of
the list items, along with using live regions to update them when the state
changes:
https://medium.com/salesforce-ux/4-major-patterns-for-accessible-drag-and-drop-1d43f64ebf09#0303
.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#245 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE4OZC6AP45ABETFNLX6AFTS6WV5HANCNFSM4XHA4EFA>
.
|
Currently,
tabindex = 0
is being added to the drop zone even when no element is being dragged:svelte-dnd-action/src/keyboardAction.js
Lines 292 to 299 in da059e6
Then, in the focus handler, we do nothing if dragging is not in progress:
svelte-dnd-action/src/keyboardAction.js
Lines 85 to 87 in da059e6
I don't think it makes sense to make an element focusable if we do nothing when it takes focus. Plus, it leads to weird styling on empty lists. (See screenshot below.)