Commit 08caef0 1 parent eb9ef45 commit 08caef0 Copy full SHA for 08caef0
File tree 1 file changed +8
-1
lines changed
src/components/internals/rich-text-plugins
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,19 @@ const plugins = [
18
18
editor . value . document . nodes . map ( node => node . text ) . toArray ( )
19
19
. length === 1 ;
20
20
const blocks = editor . value . blocks . map ( block => block . type ) . toArray ( ) ;
21
+
21
22
const hasOneBlock = blocks . length === 1 ;
22
23
const isParagraph = blocks [ 0 ] && blocks [ 0 ] === BLOCK_TAGS . p ;
23
24
24
25
const shouldUsePlaceholder =
25
- isEditorEmpty && hasOneNode && hasOneBlock && isParagraph ;
26
+ ! editor . hasPlaceholder &&
27
+ isEditorEmpty &&
28
+ hasOneNode &&
29
+ hasOneBlock &&
30
+ isParagraph ;
26
31
32
+ // eslint-disable-next-line no-param-reassign
33
+ editor . hasPlaceholder = shouldUsePlaceholder ;
27
34
return shouldUsePlaceholder ;
28
35
} ,
29
36
} ,
You can’t perform that action at this time.
0 commit comments