feat: Show collab cursor names upon loading document. (#2732)

Second attempt, adds a class to the editor for a couple of seconds when the awareness is loaded to force cursors to display
This commit is contained in:
Tom Moor
2021-11-04 17:24:23 -07:00
committed by GitHub
parent 1a6921f6c7
commit eb9ff990ac
3 changed files with 43 additions and 1 deletions

View File

@@ -40,6 +40,7 @@ export type Props = {|
maxLength?: number,
scrollTo?: string,
theme?: Theme,
className?: string,
handleDOMEvents?: Object,
readOnlyWriteCheckboxes?: boolean,
onBlur?: (event: SyntheticEvent<>) => any,
@@ -276,6 +277,7 @@ const StyledEditor = styled(RichMarkdownEditor)`
}
> div {
opacity: 0;
transition: opacity 100ms ease-in-out;
position: absolute;
top: -1.8em;
font-size: 13px;
@@ -295,11 +297,14 @@ const StyledEditor = styled(RichMarkdownEditor)`
&:hover {
> div {
opacity: 1;
transition: opacity 100ms ease-in-out;
}
}
}
}
&.show-cursor-names .ProseMirror-yjs-cursor > div {
opacity: 1;
}
`;
const EditorTooltip = ({ children, ...props }) => (