Skip to content

Commit c97b72f

Browse files
committed
feat: fix invalid droptarget at bottom of tree (#363)
1 parent 2120817 commit c97b72f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

next-release-notes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
### Bug Fixes and Improvements
22
- If a tree environment renders without an item defined as focused in its `viewState` parameter, it will invoke the `onFocusItem`
33
prop with the first item in the tree during its render. In the past, this was implicitly and silently set in the `viewState` prop,
4-
now this assignment is triggered explicitly with the handler call (#363)
4+
now this assignment is triggered explicitly with the handler call (#363)
5+
- Fixed a bug where an additional invalid drop target would be available at the bottom-most location when dragging via keyboard interactions (#363)

packages/core/src/drag/DragAndDropProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export const DragAndDropProvider: React.FC<React.PropsWithChildren> = ({
282282
if (environment.activeTreeId) {
283283
setProgrammaticDragIndex(oldIndex =>
284284
Math.min(
285-
viableDragPositions[environment.activeTreeId!].length,
285+
viableDragPositions[environment.activeTreeId!].length - 1,
286286
oldIndex + 1
287287
)
288288
);

0 commit comments

Comments
 (0)