From f5a91be53c67e296b04912aaa5c023a05be82d7d Mon Sep 17 00:00:00 2001 From: zzj3720 <17165520+zzj3720@users.noreply.github.com> Date: Fri, 28 Mar 2025 08:19:46 +0000 Subject: [PATCH] fix(editor): support reactive readonly for table block (#11248) fix: BS-2957 --- .../affine/blocks/block-table/src/selection-controller.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/blocksuite/affine/blocks/block-table/src/selection-controller.ts b/blocksuite/affine/blocks/block-table/src/selection-controller.ts index 1284d65e91..3a6c393c3d 100644 --- a/blocksuite/affine/blocks/block-table/src/selection-controller.ts +++ b/blocksuite/affine/blocks/block-table/src/selection-controller.ts @@ -29,9 +29,6 @@ export class SelectionController implements ReactiveController { this.host.addController(this); } hostConnected() { - if (this.dataManager.readonly$.value) { - return; - } this.dragListener(); this.host.handleEvent('copy', this.onCopy); this.host.handleEvent('cut', this.onCut); @@ -84,7 +81,7 @@ export class SelectionController implements ReactiveController { window.addEventListener('mouseup', onUp); } dragListener() { - if (IS_MOBILE) { + if (IS_MOBILE || this.dataManager.readonly$.value) { return; } this.host.disposables.addFromEvent(this.host, 'mousedown', event => {