Skip to content

Commit

Permalink
Merge pull request #539 from share/presence-example-update
Browse files Browse the repository at this point in the history
📝 Update Presence example
  • Loading branch information
alecgibson authored Jan 25, 2022
2 parents 9fb3091 + 0f8df7e commit ca92e02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/rich-text-presence/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ function initialiseQuill(doc) {
});
var localPresence = presence.create(presenceId);

quill.on('selection-change', function(range) {
quill.on('selection-change', function(range, oldRange, source) {
// We only need to send updates if the user moves the cursor
// themselves. Cursor updates as a result of text changes will
// automatically be handled by the remote client.
if (source !== 'user') return;
// Ignore blurring, so that we can see lots of users in the
// same window. In real use, you may want to clear the cursor.
if (!range) return;
Expand Down

0 comments on commit ca92e02

Please sign in to comment.