Skip to content

Commit

Permalink
fix: readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
golok727 committed Oct 22, 2024
1 parent d1edde1 commit 312b801
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class CaptionedBlockComponent<
${this.showBlockSelection
? html`<affine-block-selection .block=${this}></affine-block-selection>`
: nothing}
${this.useZeroWidth
${this.useZeroWidth && !this.doc.readonly
? html`<block-zero-width .block=${this}></block-zero-width>`
: nothing}
</div>`;
Expand Down
2 changes: 1 addition & 1 deletion packages/blocks/src/_common/components/block-zero-width.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down

0 comments on commit 312b801

Please sign in to comment.