From d936b56ee33e57fff8640f16aaeebc56100682e0 Mon Sep 17 00:00:00 2001 From: Gerard Rovira Date: Fri, 24 May 2024 15:29:39 +0100 Subject: [PATCH] hidden --- .../lexical-react/src/LexicalContentEditable.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/lexical-react/src/LexicalContentEditable.tsx b/packages/lexical-react/src/LexicalContentEditable.tsx index a7097a0e1c9..461a2309f40 100644 --- a/packages/lexical-react/src/LexicalContentEditable.tsx +++ b/packages/lexical-react/src/LexicalContentEditable.tsx @@ -55,9 +55,15 @@ function Placeholder({ return null; } + let placeholder = null; if (typeof content === 'function') { - return content(editable); - } else { - return content; + placeholder = content(editable); + } else if (content !== null) { + placeholder = content; + } + + if (placeholder === null) { + return null; } + return
{placeholder}
; }