Skip to content

Commit

Permalink
fix: drop on editor should prevent default (#9239)
Browse files Browse the repository at this point in the history
  • Loading branch information
Saul-Mirone committed Dec 23, 2024
1 parent 331aa47 commit e0d2f50
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import type { EmbedCardStyle, NoteBlockModel } from '@blocksuite/affine-model';
import {
EMBED_CARD_HEIGHT,
Expand Down Expand Up @@ -238,6 +237,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 @@ -262,7 +263,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 e0d2f50

Please sign in to comment.