Skip to content

Commit

Permalink
fix(blocks): blocksuite drop should prevent default
Browse files Browse the repository at this point in the history
  • Loading branch information
pengx17 committed Dec 20, 2024
1 parent cb1c432 commit f4f1109
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ export class DragEventWatcher {
const state = context.get('dndState');

const event = state.raw;
event.preventDefault();

const { clientX, clientY } = event;
const point = new Point(clientX, clientY);
const element = getClosestBlockComponentByPoint(point.clone());
Expand All @@ -265,7 +267,6 @@ export class DragEventWatcher {

const index =
parent.children.indexOf(model) + (result.type === 'before' ? 0 : 1);
event.preventDefault();

if (matchFlavours(parent, ['affine:note'])) {
const snapshot = this._deserializeSnapshot(state);
Expand Down

0 comments on commit f4f1109

Please sign in to comment.