From 3afdb0b5b85021acca227315e3107d7d60112fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Tue, 24 Mar 2026 13:07:18 +0400 Subject: [PATCH] Fix placeholder not displayed in table and lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Émile Ré --- packages/ui/src/RichEditor/PlaceholderExtension.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/ui/src/RichEditor/PlaceholderExtension.ts b/packages/ui/src/RichEditor/PlaceholderExtension.ts index 3f5b3d4cb..9c2fe3c66 100644 --- a/packages/ui/src/RichEditor/PlaceholderExtension.ts +++ b/packages/ui/src/RichEditor/PlaceholderExtension.ts @@ -27,6 +27,17 @@ export const PlaceholderExtension = Extension.create({ if (node.type.name !== "paragraph") return DecorationSet.empty; if (node.content.size !== 0) return DecorationSet.empty; + if ($pos.depth >= 2) { + const parentName = $pos.node($pos.depth - 1).type.name; + if ( + parentName === "listItem" + || parentName === "tableCell" + || parentName === "tableHeader" + ) { + return DecorationSet.empty; + } + } + const pos = $pos.before($pos.depth); return DecorationSet.create(state.doc, [