react-spectrum
6e4d003e - Implement drag and drop in React Aria (#1286)

Commit
4 years ago
Implement drag and drop in React Aria (#1286) * Initial commit for drag and drop * Initial take on keyboard dnd * Don't preventDefault in usePress if inside a draggable element * Ignore drop targets inside an aria-hidden container * Prevent normal keyboard events and pass dnd events through target * Keep valid drop targets up to date and support drag activate event on keyboard * Move focus to collection children * Fix pointerType of pointer events outside storybook iframe in mobile safari * Register focus visible global listeners on page load * Somewhat working screen reader support * Get collection drop targets working with screen readers * Cancel press on drag start in Safari * Prototype: allow tab key inside selectable items * Add option to deselect items on press up * Improve keyboard support for droppable collections and make examples prettier * Some fixes for iOS voiceover * iOS voiceover improvements * Fix usePress * Lint * Setup @react-stately/dnd package * Add draggable collection hooks * Match native macOS behavior for dragging selection * Support custom renderPreview function * Remove getDropOperation prop from useDroppableItem * Support for dropping on the collection root, and ARIA grid example * Create useDescription hook to dedup description elements * Centralize platform/browser checks in one place * Don't fire onDropExit and onDropEnter when the new target is the same as the old one * Implement auto scroll support in Safari on macOS * Support no renderPreview option for useDraggableCollection * Determine whether two drop targets are equivalent * Add virtualized example * Implement support for Home/End and PageUp/PageDown * Support multiple items of the same type, and items with multiple representations * Only render drop indicators when visible or not aria-hidden * Add example of reordering a list * Don't select on press start on drag handle * Switch to grid hooks for examples * Wait a frame to dispatch onDrop * Internationalize messages * Add initial tests for drag and drop * Tests for useDroppableCollection * useDraggableCollection tests * Revert table test skips * Add tests for usePress changes * Add test for ariaHideOutside VO workaround * Add tests for useListData changes * Add missing return Co-authored-by: Danni <drobinson@livefyre.com>
Author
Parents
Loading