Skip to content

Commit 9057f5e

Browse files
committed
cleanup
1 parent 5f58b9f commit 9057f5e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ interface PointerTracking {
1919
xDirection: 'left' | 'right' | null,
2020
boundaryContext: {
2121
parentKey: Key,
22-
lastChildKey: Key,
2322
lastSwitchY: number,
2423
lastSwitchX: number,
25-
entryDirection: 'up' | 'down' | null,
2624
preferredTargetIndex?: number
2725
} | null
2826
}
@@ -128,7 +126,7 @@ export class TreeDropTargetDelegate<T> {
128126

129127
// If target has children and is expanded, use "before first child"
130128
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;
132130
for (let child of collection.getChildren(currentItem.key)) {
133131
if (child.type === 'item') {
134132
firstChildItemNode = child;
@@ -230,19 +228,17 @@ export class TreeDropTargetDelegate<T> {
230228
let initialTargetIndex = tracking.yDirection === 'up' ? potentialTargets.length - 1 : 0;
231229
tracking.boundaryContext = {
232230
parentKey,
233-
lastChildKey: originalTarget.key,
234231
preferredTargetIndex: initialTargetIndex,
235232
lastSwitchY: y,
236-
lastSwitchX: x,
237-
entryDirection: tracking.yDirection
233+
lastSwitchX: x
238234
};
239235
}
240236

241237
let boundaryContext = tracking.boundaryContext;
242238
let distanceFromLastXSwitch = Math.abs(x - boundaryContext.lastSwitchX);
243239
let distanceFromLastYSwitch = Math.abs(y - boundaryContext.lastSwitchY);
244240

245-
// Toggle between targets based on Y movement
241+
// Switch between targets based on Y movement
246242
if (distanceFromLastYSwitch > Y_SWITCH_THRESHOLD && currentYMovement) {
247243
let currentIndex = boundaryContext.preferredTargetIndex || 0;
248244

0 commit comments

Comments
 (0)