From 312b801375dbe42d7c219559aab7bbf386ff2bcf Mon Sep 17 00:00:00 2001 From: Aadi Date: Tue, 22 Oct 2024 13:15:08 +0530 Subject: [PATCH] fix: readonly --- .../affine/components/src/caption/captioned-block-component.ts | 2 +- packages/blocks/src/_common/components/block-zero-width.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/affine/components/src/caption/captioned-block-component.ts b/packages/affine/components/src/caption/captioned-block-component.ts index 0ded09b5f643f..d464065922b7f 100644 --- a/packages/affine/components/src/caption/captioned-block-component.ts +++ b/packages/affine/components/src/caption/captioned-block-component.ts @@ -42,7 +42,7 @@ export class CaptionedBlockComponent< ${this.showBlockSelection ? html`` : nothing} - ${this.useZeroWidth + ${this.useZeroWidth && !this.doc.readonly ? html`` : nothing} `; diff --git a/packages/blocks/src/_common/components/block-zero-width.ts b/packages/blocks/src/_common/components/block-zero-width.ts index ff38052112e69..0dd8cbee2cb09 100644 --- a/packages/blocks/src/_common/components/block-zero-width.ts +++ b/packages/blocks/src/_common/components/block-zero-width.ts @@ -24,7 +24,7 @@ export class BlockZeroWidth extends LitElement { handleClick(e: MouseEvent) { stopPropagation(e); if (this.block.doc.readonly) return; - const nextBlock = this.block.model.doc.getNext(this.block.model); + const nextBlock = this.block.doc.getNext(this.block.model); if (nextBlock?.flavour !== 'affine:paragraph') { const [paragraphId] = this.block.doc.addSiblingBlocks(this.block.model, [ { flavour: 'affine:paragraph' },