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

fix(#3220): DragManager force forms mode when dragging

Open majornista opened this issue 2 years ago โ€ข 17 comments

Closes #3220

โœ… Pull Request Checklist:

  • [x] Included link to corresponding React Spectrum GitHub Issue #3220.
  • [x] Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • [x] Filled out test instructions.
  • [ ] Updated documentation (if it already exists for this component).
  • [x] Looked at the Accessibility Practices for this feature - Aria Practices

๐Ÿ“ Test Instructions:

  1. Using Windows with either JAWS or NVDA screen reader, open https://reactspectrum.blob.core.windows.net/reactspectrum/686489b2774e1238e3c4f1abc42593cbbba5e92b/storybook/index.html?path=/story/drag-and-drop--default&id=drag-and-drop--default&providerSwitcher-toastPosition=bottom&viewMode=story
  2. In browse mode/virtual cursor mode, navigate to the button labelled "Drag me."
  3. The dragDescriptionVirtual message, "Click to start dragging." does not get announced.
  4. Press Space or Enter key to activate the "Drag me" button and start dragging.
  5. NVDA or JAWS should shift into forms mode.
  6. The live announcer will announce the, dragStartedVirtual message, "Started dragging. Navigate to a drop target, then click or press Enter to drop," followed by the endDragVirtual message, "Dragging. Click to cancel drag."
  7. Use down arrow to move the virtual cursor to the first available drop target, a button labelled, "Drop here."
  8. The screen reader should to announce the dropDescriptionVirtual, "Click to drop."
  9. Press Enter key to complete drop action.
  10. The live announcer will announce the dropComplete message, "Drop complete."

๐Ÿงข Your Project:

Adobe/Accessibility

majornista avatar Jun 13 '22 17:06 majornista

I want to investigate why adding role="application" to document.body doesn't work as you mentioned in https://github.com/adobe/react-spectrum/pull/3221#discussion_r897042186. With the current implementation this may still happen, for example, if the common ancestor of all of the drop targets is the body. Not sure how we would handle that case if adding role="application" to the body really doesn't work. Since dnd is in our current priorities, we'll look at this before the GA release unless you get to it first.

devongovett avatar Aug 08 '22 20:08 devongovett

What's the status of this PR? I think a recently merged PR of Devon's addressed some of this last I heard

snowystinger avatar Oct 05 '22 22:10 snowystinger

What's the status of this PR? I think a recently merged PR of Devon's addressed some of this last I heard

I think we may be able to close this. Rakesh tested with and without this change, and I think the behavior using role="application" wasn't significantly better. Drag and Drop now announces when the Drag operation starts, and we hide non-drop targets, so forcing forms mode doesn't do much beyond forcing thus user to Tab, which Rakesh actually found somewhat confusing.

majornista avatar Oct 06 '22 17:10 majornista