react-spectrum
e817a49a - fix(#3220): move startDragging into useDrags onKeyDownCapture event handler

Comment changes are shownComment changes are hidden
Commit
2 years ago
fix(#3220): move startDragging into useDrags onKeyDownCapture event handler DragManager cancels dragging in the onKeyDown event handler for the Enter key with focus on an element other than a drop target. (See https://github.com/adobe/react-spectrum/pull/3524/files#diff-9ecdd8ce235e2d0ed03039e2a77c90ec547a293f538f6744d10f194e5f557c62L226-L233). We should move startDragging(e.target as HTMLElement); to the onKeyDownCapture event handler in useDrag, or move the logic for cancelling the drag to a new onKeyUp handler within DragManager, so that cancelling a drag operation in forms mode, by pressing Enter with focus on the drag target, does not immediately start a new drag operation on key up.
Author
Michael Jordan
Parents
  • packages/@react-aria/dnd/src
    • File
      useDrag.ts
Loading