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

Handle dragging with NVDA/JAWS in browse mode

Open devongovett opened this issue 3 years ago • 2 comments

Related to #3221

After https://github.com/adobe/react-spectrum/pull/3421, it isn't possible to trigger drag and drop while in browse mode in NVDA/JAWS. This is the default when navigating to button elements, like in the default dnd story. In browse mode, only an onClick event is fired. Keyboard events are not fired.

Solution is to add an onClick handler that only applies if a virtual click is detected. This means that there can be no other click events on the element, because we cannot distinguish Enter from Space. For standalone draggable elements I think this is probably ok. For elements within collections, where we might have selection, we remove the onClick handler, which is ok because NVDA/JAWS are always in forms mode within collections.

This also centralizes the isVirtualClick and isVirtualPointerEvent functions into @react-aria/utils, and fixes dropping on button drop targets in browse mode.

devongovett avatar Sep 16 '22 02:09 devongovett

This is weird because that line was really meant for Android Talkback but ok...

devongovett avatar Sep 29 '22 17:09 devongovett