react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

Remove warning requesting that collections with DnD have a button with slot="drag"

Open GermanJablo opened this issue 2 years ago โ€ข 4 comments

Provide a general summary of the issue here

A draggable button isn't the only way to provide an alternative, accessible method for DnD.

I haven't found anything in W3 and the Aria spec that indicates this has to be mandatory.

A very common pattern is to have, within the item, a dropdown menu where one of the options is "move".

image

๐Ÿค” Expected Behavior?

slot="drag" should not be mandatory

๐Ÿ˜ฏ Current Behavior

The console shows the following warning:

Draggable items in a GridList must contain a <Button slot="drag"> element so that keyboard and screen reader users can drag them.

๐Ÿ’ Possible Solution

One option would be to be able to deactivate the warning in some way, although in my opinion it should not appear directly.

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

See the console on https://codesandbox.io/p/sandbox/thirsty-sky-mtqsp9

Version

1.0.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Windows

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

GermanJablo avatar Jan 15 '24 21:01 GermanJablo

Thanks for the issue, do you want the menu item to trigger our drag and drop system? or would it bypass it entirely?

snowystinger avatar Jan 18 '24 21:01 snowystinger

No, please, thanks to you.

I couldn't tell you exactly, I'm still experimenting.

Regardless of that, what I want is for the warning to be removed, since it is incorrect.

GermanJablo avatar Jan 18 '24 22:01 GermanJablo

Any updates from your experimentation? We are of different minds depending on the need here.

snowystinger avatar Feb 19 '24 06:02 snowystinger

Sorry, I don't understand what information you would like to know exactly. I want to bypass the restriction, and not offer an alternative drag and drop method. As I said, I think the warning is incorrect since I haven't found anything in W3 and the Aria spec that indicates this has to be mandatory.

GermanJablo avatar Feb 21 '24 02:02 GermanJablo

Our stance is to ensure accessible patterns. This includes drag and drop. If it's something a mouse user can do, then it's something everyone can do. If you want to offer an alternative for activating drag and drop, that's fine, but we want to know more about the use case so that we can see if we can check for either implementation and provide docs around how we'd expect it to work.

For instance, maybe that "Move to" button enters our drag and drop Or maybe it opens a dialog where you have a list of names of other locations

If it's the first one, we'd need to add some ways of starting the drag and drop programmatically. For the second way, we'd need to discuss more.

So what we want to know is, how do you expect this to work in your app? Do you expect 1, or 2? Or some other option I haven't named?

snowystinger avatar Feb 23 '24 22:02 snowystinger

I really don't like having to decide between those 2 options.

If I had to choose, I would say option 2 of those you mention, since my idea is at some point when I have time to implement option 2.

In the meantime though, I don't want to have an alternative method of DnD to mouse or touch. I consider those two (mouse and touch) to be sufficient and that we should be able to at least opt out of the warning in some way.

In fact, I think DnD with the keyboard is an anti-pattern. I didn't intend to make this thread a discussion about that but it seems that you are very convinced that DnD should always be able to be done with a keyboard.

I would think that if the library is called React-aria it is because it follows the aria spec. But here I think there is an attempt to impose a philosophy of accessibility that I do not find anywhere in the aria specification and that also seems incorrect IMHO.

GermanJablo avatar Feb 24 '24 21:02 GermanJablo

From WCAG: https://www.w3.org/WAI/WCAG21/Understanding/keyboard.html

All functionality of the content is operable through a keyboard interface without requiring specific timings for individual keystrokes, except where the underlying function requires input that depends on the path of the user's movement and not just the endpoints.

devongovett avatar Feb 24 '24 21:02 devongovett

Thank you very much. That was what I was trying to find and couldn't. In that case, I would like to be able to implement option 2. That is, the "Move to" button opens a dialog where you have a list of names of other locations.

GermanJablo avatar Feb 25 '24 02:02 GermanJablo