mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-11 05:58:56 +08:00
fix: allow to drop inside the note block in edgeless mode (#10255)
This commit is contained in:
@@ -1328,6 +1328,7 @@ export class DragEventWatcher {
|
||||
|
||||
private _makeDropTarget(view: BlockComponent) {
|
||||
const isUnderNote = this._isUnderNoteBlock(view.model);
|
||||
const isNote = matchModels(view.model, [NoteBlockModel]);
|
||||
|
||||
if (
|
||||
// affine:surface block can't be drop target in any modes
|
||||
@@ -1372,6 +1373,16 @@ export class DragEventWatcher {
|
||||
|
||||
return false;
|
||||
},
|
||||
onDragEnter: () => {
|
||||
if (isNote && 'hideMask' in view) {
|
||||
view.hideMask = true;
|
||||
}
|
||||
},
|
||||
onDragLeave: () => {
|
||||
if (isNote && 'hideMask' in view) {
|
||||
view.hideMask = false;
|
||||
}
|
||||
},
|
||||
setDropData: () => {
|
||||
return {
|
||||
modelId: view.model.id,
|
||||
|
||||
Reference in New Issue
Block a user