mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-04 22:40:29 +03:00
Swap to using that implementation
This commit is contained in:
parent
46d7a9c0bf
commit
cb9dfceb7c
1 changed files with 11 additions and 16 deletions
|
|
@ -106,22 +106,17 @@ export const CustomEditor = forwardRef<HTMLDivElement, CustomEditorProps>(
|
||||||
[editor, onKeyDown]
|
[editor, onKeyDown]
|
||||||
);
|
);
|
||||||
|
|
||||||
const renderPlaceholder = useCallback(({ attributes, children }: RenderPlaceholderProps) => {
|
const renderPlaceholder = useCallback(
|
||||||
// drop style attribute as we use our custom placeholder css.
|
({ attributes, children }: RenderPlaceholderProps) => (
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
<span {...attributes} className={css.EditorPlaceholderContainer}>
|
||||||
const { style, ...props } = attributes;
|
{/* Inner component to style the actual text position and appearance */}
|
||||||
return (
|
<Text as="span" className={css.EditorPlaceholderTextVisual} truncate>
|
||||||
<Text
|
|
||||||
as="span"
|
|
||||||
{...props}
|
|
||||||
className={css.EditorPlaceholder}
|
|
||||||
contentEditable={false}
|
|
||||||
truncate
|
|
||||||
>
|
|
||||||
{children}
|
{children}
|
||||||
</Text>
|
</Text>
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
[]
|
||||||
);
|
);
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={css.Editor} ref={ref}>
|
<div className={css.Editor} ref={ref}>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue