At the moment, when we add a selection using span elements, they
appear further down the DOM, and hence are put "on top" of the editor
text. In other words, if another user has highlighted some text, then
their selection will prevent me from placing my cursor inside it.
This change moves the selection behind the text with a z-index: -1,
which avoids intercepting the click on the editor. It should be noted
that this will also hide the selections if a background is applied to
the editor, but fixing that case is left to the consumer.
Fixes https://github.com/reedsy/quill-cursors/issues/32
At the moment, when we add a selection using
span
elements, they appear further down the DOM, and hence are put "on top" of the editor text. In other words, if another user has highlighted some text, then their selection will prevent me from placing my cursor inside it.This change moves the selection behind the text with a
z-index: -1
, which avoids intercepting the click on the editor. It should be noted that this will also hide the selections if a background is applied to the editor, but fixing that case is left to the consumer.