Skip to content

Commit aed269e

Browse files
committed
chore: clean up maybeMapToBottomOffset implementation
1 parent 6fbb6bc commit aed269e

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

packages/core/src/drag/DraggingPositionEvaluation.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -175,20 +175,12 @@ export class DraggingPositionEvaluation {
175175
if (!priorItem || priorItem?.depth === undefined) return;
176176

177177
const depthDistanceToPrior = priorItem.depth - this.targetItem.depth;
178+
178179
if (
179180
this.offset === 'top' &&
180-
this.targetItem.depth === (priorItem?.depth ?? -1)
181-
) {
182-
// map inside folder
183-
this.offset = 'bottom';
184-
this.linearIndex -= 1;
185-
this.targetItem = this.env.linearItems[this.treeId][this.linearIndex];
186-
} else if (
187-
this.offset === 'top' &&
188-
depthDistanceToPrior > 0 &&
189-
this.indentation !== undefined
181+
(depthDistanceToPrior === 0 ||
182+
(depthDistanceToPrior > 0 && this.indentation !== undefined))
190183
) {
191-
// map at bottom of folder, up inside folder contents
192184
this.offset = 'bottom';
193185
this.linearIndex -= 1;
194186
this.targetItem = this.env.linearItems[this.treeId][this.linearIndex];

0 commit comments

Comments
 (0)