Skip to main content

Scroll Synchronization

The collab client comes with scroll synchronization support. When the author of the document joins scroll sync mode and scrolls, anyone else viewing that document can automatically scroll with the author.

joinScrollSync#

To join the scroll sync, you can use the joinScrollSync function:

client.joinScrollSync();
Note

The scroll sync will only available for document members when the author of the document is already joined scroll sync, otherwise, it will throw an error.

scrollSyncAvailable#

To check if the scroll sync is available for the user, you can use the scrollSyncAvailable function.

client.scrollSyncAvailable(): Promise<boolean>

Scroll sync status changed event#

You can also subscribe to the scrollSyncStatusChanged event to get notified when the scroll sync becomes available.

leaveScrollSync#

To leave the scroll sync, you can use the leaveScrollSync function:

client.leaveScrollSync();
Note

When the author of the document leaves scroll sync or disconnect, the other document member in the scroll sync will automatically leave scroll sync.