You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When using the CollaborationCursor extension, the selectionUpdate event fires when another user is moving their cursor around in the doc.
editor.on('selectionUpdate',()=>{// This will fire if another user clicks around the doc in their own browser })
Steps to reproduce the bug
Steps to reproduce the behavior:
Setup the basic CollaborationCursor demo
Add a listener for editor.on('selectionUpdate', onSelectionUpdate)
Open 2 browsers and click around in 1
Observe both clients firing the event handler
Expected behavior
While it may technically be true that the selection is changing, it would be nice to know if the event is firing due to this client or another.
Suggested API - If there is a notion of this client's id, passing that along would allow filtering. Otherwise, just isThisClient would suffice
editor.on('selectionUpdate', ({ editor, clientId or isThisClient }) => ...)
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
I’ve added the current transaction to the selectionUpdate event so you can check for remote changes now.
import{ySyncPluginKey}from'y-prosemirror'newEditor({onSelectionUpdate: ({ transaction })=>{// ignore changes made by y.jsif(transaction.getMeta(ySyncPluginKey)){return}console.log('selection update')}})
Description
When using the CollaborationCursor extension, the
selectionUpdate
event fires when another user is moving their cursor around in the doc.Steps to reproduce the bug
Steps to reproduce the behavior:
editor.on('selectionUpdate', onSelectionUpdate)
Expected behavior
While it may technically be true that the selection is changing, it would be nice to know if the event is firing due to this client or another.
Suggested API - If there is a notion of this client's id, passing that along would allow filtering. Otherwise, just
isThisClient
would sufficeeditor.on('selectionUpdate', ({ editor, clientId or isThisClient }) => ...)
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: