mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
perf(editor): optimize the search for the closest element (#9587)
Closes: [BS-2275](https://linear.app/affine-design/issue/BS-2275/拖拽-indicator-查找优化)
This commit is contained in:
@@ -262,7 +262,7 @@ export class DatabaseBlockComponent extends CaptionedBlockComponent<
|
||||
const model = this.doc.getBlock(id)?.model;
|
||||
const target = result.modelState.model;
|
||||
let parent = this.doc.getParent(target.id);
|
||||
const shouldInsertIn = result.type === 'in';
|
||||
const shouldInsertIn = result.placement === 'in';
|
||||
if (shouldInsertIn) {
|
||||
parent = target;
|
||||
}
|
||||
@@ -274,7 +274,7 @@ export class DatabaseBlockComponent extends CaptionedBlockComponent<
|
||||
[model],
|
||||
parent,
|
||||
target,
|
||||
result.type === 'before'
|
||||
result.placement === 'before'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user