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

Support multi-selections in awareness #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mosquitochang
Copy link

This PR is to support multi-selections in awareness, which is requested in #18.

  • Refactored some code into util functions createSelectionAnchorAndHead and createRemoteSelectionDecoration.
  • Added a new local state field secondarySelections, which is used to render decorations for secondary selections.
  • Changed createRelativeSelection to createRelativeSelections, saving all current selections instead of only one.
  • Added new classnames yRemoteSelection-primary, yRemoteSelectionHead-primary, yRemoteSelection-secondary, yRemoteSelectionHead-secondary for multi-selection styling, and added corresponding CSS in the demo file.

Demo:

2024-01-29.6.45.14.mp4

cc @dmonad


Review PR in StackBlitz Submitted with StackBlitz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant