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