-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: Fix crash in RAC Table DnD keyboard navigation #8645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
LFDanLu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delay, but looks good to me. Did some extra testing around sections + DnD and tree loaders + DnD but the things I found are unrelated to your changes here so I'll file some issues for the team to handle later. Thanks for the fix!
| @@ -195,7 +195,7 @@ export function renderAfterDropIndicators(collection: ICollection<Node<unknown>> | |||
| let afterIndicators: ReactNode[] = []; | |||
| if (nextItemInSameLevel == null) { | |||
| let current: Node<unknown> | null = node; | |||
| while (current && (!nextItemInFlattenedCollection || (current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level))) { | |||
| while (current?.type === 'item' && (!nextItemInFlattenedCollection || (current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level))) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might need to tweak to for the eventual tree with sections case? This is fine for now, I'm not really sure if after drop positions would ever become available for sections
* test * Fix crash on renderAfterDropIndicators in Table * Fix table dnd keyboard navigation
Closes
tablebody,loader) since they can't be drop targets.✅ Pull Request Checklist:
📝 Test Instructions:
In the Dnd Table Example/tableview dnd story, start a keyboard drag session and hold ArrowUp to cycle through the table multiple times.
🧢 Your Project: