Skip to content

Commit

Permalink
add nonbreaking spaces before remote-cursor-name - fixes yjs#97
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonad authored and Ronny Roeller committed May 11, 2022
1 parent 57e321e commit 730785a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/cursor-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export const defaultCursorBuilder = user => {
const userDiv = document.createElement('div')
userDiv.setAttribute('style', `background-color: ${user.color}`)
userDiv.insertBefore(document.createTextNode(user.name), null)
const nonbreakingSpace1 = document.createTextNode('\u2060')
const nonbreakingSpace2 = document.createTextNode('\u2060')
cursor.insertBefore(nonbreakingSpace1, null)
cursor.insertBefore(userDiv, null)
cursor.insertBefore(nonbreakingSpace2, null)
return cursor
}

Expand Down

0 comments on commit 730785a

Please sign in to comment.