feat:improve katex popup position

This commit is contained in:
fantasticit 2022-04-03 11:36:45 +08:00
parent daa0849e1e
commit dadc08c39a
1 changed files with 3 additions and 2 deletions

View File

@ -20,7 +20,7 @@ export const KatexWrapper = ({ editor, node, updateAttributes }) => {
} }
}, [text]); }, [text]);
const content = text ? ( const content = text.trim() ? (
<span contentEditable={false} dangerouslySetInnerHTML={{ __html: formatText }}></span> <span contentEditable={false} dangerouslySetInnerHTML={{ __html: formatText }}></span>
) : ( ) : (
<span contentEditable={false}></span> <span contentEditable={false}></span>
@ -32,10 +32,11 @@ export const KatexWrapper = ({ editor, node, updateAttributes }) => {
{isEditable ? ( {isEditable ? (
<Popover <Popover
showArrow showArrow
position="bottomLeft"
content={ content={
<div style={{ width: 320 }}> <div style={{ width: 320 }}>
<TextArea <TextArea
autoFocus autofocus
placeholder="输入公式" placeholder="输入公式"
autosize autosize
rows={3} rows={3}