fix: allow first table drag interaction #10423 - #10602
Open
anu-priya-1999 wants to merge 2 commits into
Open
anu-priya-1999 wants to merge 2 commits into
anu-priya-1999 wants to merge 2 commits into
Conversation
Member
|
Looks like this is failing a test |
Author
|
Thanks for the feedback. I tracked the failing test down to the drag I updated the fix so the temporary Validated locally:
The full CircleCI suite is now passing as well. The remaining merge blockers are the required reviews and maintainer approval for the workflow. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #10423
Fixes an issue where the first drag interaction on a draggable React Aria Table row could fail when initiated from the row's drag handle.
Root cause
useGridCelltemporarily removes the cell'stabIndexon pointer down when selection occurs on press up. This prevents the browser from focusing the cell while starting a drag.The logic previously only installed this handler when
gridCellProps.onPointerDownwas not already defined. With the currentuseSelectableItembehavior, the cell can already have anonPointerDownhandler, causing theuseGridCellhandler to be skipped entirely.As a result, the cell keeps its
tabIndexduring the first drag interaction and the drag handle can fail to start the drag correctly.Fix
useGridCellpointer-down handling whenshouldSelectOnPressUpandtabIndexare applicable.onPointerDownhandler instead of replacing it.tabIndexduring pointer interaction.Testing
Added a regression test verifying that the cell's
tabIndexis removed on the first drag interaction and restored afterward.Validated with:
packages/react-aria-components/test/Table.test.js