mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-09-13 14:22:25 +03:00
Fix room input for virtual keyboard on webkit (#2346)
* Slate style has certain behavior elements that iOS expects * Swap to using that implementation
This commit is contained in:
parent
6a27720709
commit
34dd64103c
2 changed files with 20 additions and 25 deletions
|
@ -41,21 +41,21 @@ export const EditorTextarea = style([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const EditorPlaceholder = style([
|
export const EditorPlaceholderContainer = style([
|
||||||
DefaultReset,
|
DefaultReset,
|
||||||
{
|
{
|
||||||
position: 'absolute',
|
|
||||||
zIndex: 1,
|
|
||||||
width: '100%',
|
|
||||||
opacity: config.opacity.Placeholder,
|
opacity: config.opacity.Placeholder,
|
||||||
pointerEvents: 'none',
|
pointerEvents: 'none',
|
||||||
userSelect: 'none',
|
userSelect: 'none',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
selectors: {
|
export const EditorPlaceholderTextVisual = style([
|
||||||
'&:not(:first-child)': {
|
DefaultReset,
|
||||||
display: 'none',
|
{
|
||||||
},
|
display: 'block',
|
||||||
},
|
paddingTop: toRem(13),
|
||||||
|
paddingLeft: toRem(1),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -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