chore(editor): improve selection of doc in canvas (#11314)

Close [BS-2705](https://linear.app/affine-design/issue/BS-2705/[improvement]-通过-viability-control-选择-hide-in-edgeless)

This PR disabled selecting operation of notes that are only shown in page mode.
This commit is contained in:
L-Sun
2025-03-31 12:35:02 +00:00
parent 587fea02b8
commit fec698fd8b
4 changed files with 107 additions and 28 deletions

View File

@@ -10,6 +10,8 @@ import {
type ConnectorElementModel,
GroupElementModel,
MindmapElementModel,
NoteBlockModel,
NoteDisplayMode,
} from '@blocksuite/affine-model';
import { resetNativeSelection } from '@blocksuite/affine-shared/utils';
import { DisposableGroup } from '@blocksuite/global/disposable';
@@ -141,6 +143,12 @@ export class DefaultTool extends BaseTool {
if (el instanceof MindmapElementModel) {
return bound.contains(el.elementBound);
}
if (
el instanceof NoteBlockModel &&
el.props.displayMode === NoteDisplayMode.DocOnly
) {
return false;
}
return true;
});