mirror of
https://github.com/cudr/slate-collaborative.git
synced 2024-10-27 20:34:06 +00:00
fix: caret styles
This commit is contained in:
parent
aa2255a03c
commit
e26d62f78d
@ -18,12 +18,17 @@ const Caret: React.FC<Caret> = ({ color, isForward, name }) => {
|
|||||||
left: isForward ? '100%' : '0%'
|
left: isForward ? '100%' : '0%'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
caretStyles[isForward ? 'bottom' : 'top'] = 0
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<span contentEditable={false} style={cursorStyles}>
|
<span contentEditable={false} style={caretStyles}>
|
||||||
{name}
|
<span style={{ position: 'relative' }}>
|
||||||
|
<span contentEditable={false} style={cursorStyles}>
|
||||||
|
{name}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span contentEditable={false} style={caretStyles} />
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -44,7 +49,6 @@ const cursorStyleBase = {
|
|||||||
|
|
||||||
const caretStyleBase = {
|
const caretStyleBase = {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: 0,
|
|
||||||
pointerEvents: 'none',
|
pointerEvents: 'none',
|
||||||
userSelect: 'none',
|
userSelect: 'none',
|
||||||
height: '1.2em',
|
height: '1.2em',
|
||||||
|
Loading…
Reference in New Issue
Block a user