Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(page): unexpected placeholder #5295

Merged
merged 1 commit into from
Nov 12, 2023
Merged

Conversation

zqran
Copy link
Sponsor Member

@zqran zqran commented Nov 12, 2023

close: #5204

before:

2023-11-12.12.11.05.mov

after:

2023-11-12.12.10.32.mov

Copy link

vercel bot commented Nov 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blocksuite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 12, 2023 4:14am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
blocksuite-docs ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2023 4:14am

@Flrande Flrande changed the title fix: unexpected placeholder fix(page): unexpected placeholder Nov 12, 2023
const textSelection = remoteSelections?.find(
selection => selection.type === 'text'
);
if (textSelection) {
Copy link
Member

Choose a reason for hiding this comment

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

Why we need to check textSelection here?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Suppose there are two users A and B. User A creates #. At this time, user B only needs to update the placehoder when it senses data changes. Here, remoteSelections is mainly used to determine whether it is user B.

Only when it is a text selection, it means that the user is in editing mode. This can avoid unnecessary updates.

@Flrande Flrande merged commit e541b49 into master Nov 12, 2023
22 checks passed
@Flrande Flrande deleted the 1112-paragraph-placeholder branch November 12, 2023 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

Unexpected placeholder
3 participants