fix: drop on editor should prevent default (#9239)
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
||||||
import type { EmbedCardStyle, NoteBlockModel } from '@blocksuite/affine-model';
|
import type { EmbedCardStyle, NoteBlockModel } from '@blocksuite/affine-model';
|
||||||
import {
|
import {
|
||||||
EMBED_CARD_HEIGHT,
|
EMBED_CARD_HEIGHT,
|
||||||
@@ -238,6 +237,8 @@ export class DragEventWatcher {
|
|||||||
const state = context.get('dndState');
|
const state = context.get('dndState');
|
||||||
|
|
||||||
const event = state.raw;
|
const event = state.raw;
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
const { clientX, clientY } = event;
|
const { clientX, clientY } = event;
|
||||||
const point = new Point(clientX, clientY);
|
const point = new Point(clientX, clientY);
|
||||||
const element = getClosestBlockComponentByPoint(point.clone());
|
const element = getClosestBlockComponentByPoint(point.clone());
|
||||||
@@ -262,7 +263,6 @@ export class DragEventWatcher {
|
|||||||
|
|
||||||
const index =
|
const index =
|
||||||
parent.children.indexOf(model) + (result.type === 'before' ? 0 : 1);
|
parent.children.indexOf(model) + (result.type === 'before' ? 0 : 1);
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
if (matchFlavours(parent, ['affine:note'])) {
|
if (matchFlavours(parent, ['affine:note'])) {
|
||||||
const snapshot = this._deserializeSnapshot(state);
|
const snapshot = this._deserializeSnapshot(state);
|
||||||
|
|||||||
Reference in New Issue
Block a user