diff --git a/.changeset/twenty-cows-count.md b/.changeset/twenty-cows-count.md new file mode 100644 index 0000000000..51e72a84b1 --- /dev/null +++ b/.changeset/twenty-cows-count.md @@ -0,0 +1,5 @@ +--- +'@udecode/plate-utils': minor +--- + +Suppress all placeholders when element is composing diff --git a/packages/plate-utils/src/react/usePlaceholder.ts b/packages/plate-utils/src/react/usePlaceholder.ts index d25de41851..e20e04e3cb 100644 --- a/packages/plate-utils/src/react/usePlaceholder.ts +++ b/packages/plate-utils/src/react/usePlaceholder.ts @@ -26,17 +26,13 @@ export const usePlaceholderState = ({ const composing = useComposing(); const editor = useEditorRef(); - const isEmptyBlock = isElementEmpty(editor, element); + const isEmptyBlock = isElementEmpty(editor, element) && !composing; const enabled = isEmptyBlock && (!query || queryNode([element, findNodePath(editor, element)!], query)) && (!hideOnBlur || - (isCollapsed(editor.selection) && - hideOnBlur && - focused && - selected && - !composing)); + (isCollapsed(editor.selection) && hideOnBlur && focused && selected)); return { enabled,