fix: caret styles

This commit is contained in:
cudr 2020-05-17 15:43:56 +03:00
parent aa2255a03c
commit e26d62f78d

View File

@ -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',