Skip to content

Commit 5644a71

Browse files
authored
only normalize to 'after' target if valid (#8563)
1 parent 674aa4a commit 5644a71

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/react-aria-components/src/TreeDropTargetDelegate.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,15 @@ export class TreeDropTargetDelegate<T> {
8484
if (target.dropPosition === 'before') {
8585
let keyBefore = this.state!.collection.getKeyBefore(target.key);
8686
if (keyBefore != null) {
87-
target = {
87+
let convertedTarget = {
8888
type: 'item',
8989
key: keyBefore,
9090
dropPosition: 'after'
9191
} as const;
92+
93+
if (isValidDropTarget(convertedTarget)) {
94+
target = convertedTarget;
95+
}
9296
}
9397
}
9498

0 commit comments

Comments
 (0)