File tree 2 files changed +6
-7
lines changed
2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ import {
96
96
insertListItemAt ,
97
97
insertTemplateAt ,
98
98
} from "~/builder/features/workspace/canvas-tools/outline/block-utils" ;
99
+ import { editablePlaceholderComponents } from "~/canvas/shared/styles" ;
99
100
100
101
const BindInstanceToNodePlugin = ( {
101
102
refs,
@@ -1605,11 +1606,8 @@ export const TextEditor = ({
1605
1606
}
1606
1607
1607
1608
// Components with pseudo-elements (e.g., ::marker) that prevent content from collapsing
1608
- const componentsWithPseudoElementChildren = [
1609
- "ListItem" ,
1610
- "Paragraph" ,
1611
- "Heading" ,
1612
- ] ;
1609
+ const componentsWithPseudoElementChildren =
1610
+ editablePlaceholderComponents ;
1613
1611
1614
1612
// opinionated: Non-collapsed elements without children can act as spacers (they have size for some reason).
1615
1613
if (
Original file line number Diff line number Diff line change @@ -88,9 +88,10 @@ const helperStylesShared = [
88
88
` ,
89
89
90
90
// Display a placeholder text for elements that are editing but empty (Lexical adds p>br children)
91
- `:is(${ editablePlaceholderSelector } )[contenteditable]:has( p:only-child > br:only-child) {
91
+ `:is(${ editablePlaceholderSelector } )[contenteditable] > p:only-child:has( br:only-child) {
92
92
position: relative;
93
- & > p:after {
93
+ display: block;
94
+ &:after {
94
95
content: var(${ editingPlaceholderVariable } );
95
96
position: absolute;
96
97
left: 0;
You can’t perform that action at this time.
0 commit comments