Skip to content

Commit

Permalink
fix(page): unexpected placeholder (#5295)
Browse files Browse the repository at this point in the history
  • Loading branch information
zqran committed Nov 12, 2023
1 parent f6c23e8 commit e541b49
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/blocks/src/paragraph-block/paragraph-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,16 @@ export class ParagraphBlockComponent extends BlockElement<ParagraphBlockModel> {
this.requestUpdate();
});
this.model.childrenUpdated.on(() => this.requestUpdate());

this.page.awarenessStore.slots.update.on(v => {
const remoteSelections = this.std.selection.remoteSelections.get(v.id);
const textSelection = remoteSelections?.find(
selection => selection.type === 'text'
);
if (textSelection) {
this._updatePlaceholder();
}
});
}

private _updatePlaceholder = () => {
Expand Down

1 comment on commit e541b49

@vercel
Copy link

@vercel vercel bot commented on e541b49 Nov 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

blocksuite – ./packages/playground

blocksuite-toeverything.vercel.app
blocksuite-five.vercel.app
blocksuite-git-master-toeverything.vercel.app

Please sign in to comment.