@@ -19,10 +19,8 @@ interface PointerTracking {
19
19
xDirection : 'left' | 'right' | null ,
20
20
boundaryContext : {
21
21
parentKey : Key ,
22
- lastChildKey : Key ,
23
22
lastSwitchY : number ,
24
23
lastSwitchX : number ,
25
- entryDirection : 'up' | 'down' | null ,
26
24
preferredTargetIndex ?: number
27
25
} | null
28
26
}
@@ -128,7 +126,7 @@ export class TreeDropTargetDelegate<T> {
128
126
129
127
// If target has children and is expanded, use "before first child"
130
128
if ( currentItem && currentItem . hasChildNodes && this . state ! . expandedKeys . has ( currentItem . key ) && collection . getChildren ) {
131
- let firstChildItemNode : Node < any > | null = null ;
129
+ let firstChildItemNode : Node < T > | null = null ;
132
130
for ( let child of collection . getChildren ( currentItem . key ) ) {
133
131
if ( child . type === 'item' ) {
134
132
firstChildItemNode = child ;
@@ -230,19 +228,17 @@ export class TreeDropTargetDelegate<T> {
230
228
let initialTargetIndex = tracking . yDirection === 'up' ? potentialTargets . length - 1 : 0 ;
231
229
tracking . boundaryContext = {
232
230
parentKey,
233
- lastChildKey : originalTarget . key ,
234
231
preferredTargetIndex : initialTargetIndex ,
235
232
lastSwitchY : y ,
236
- lastSwitchX : x ,
237
- entryDirection : tracking . yDirection
233
+ lastSwitchX : x
238
234
} ;
239
235
}
240
236
241
237
let boundaryContext = tracking . boundaryContext ;
242
238
let distanceFromLastXSwitch = Math . abs ( x - boundaryContext . lastSwitchX ) ;
243
239
let distanceFromLastYSwitch = Math . abs ( y - boundaryContext . lastSwitchY ) ;
244
240
245
- // Toggle between targets based on Y movement
241
+ // Switch between targets based on Y movement
246
242
if ( distanceFromLastYSwitch > Y_SWITCH_THRESHOLD && currentYMovement ) {
247
243
let currentIndex = boundaryContext . preferredTargetIndex || 0 ;
248
244
0 commit comments