Skip to content

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