Issue #12 has something todo with Webkit and Gecko

A DIV has no height, but we solve this with CSS :empty
It's not perfect because we can still not focus when there's no BR.
Will keep digging!
This commit is contained in:
djmaze 2020-09-24 15:13:33 +02:00
parent 4257d9ca78
commit 0fde531dd3
2 changed files with 13 additions and 0 deletions

View file

@ -56,6 +56,17 @@
overflow: auto;
}
.squire-wysiwyg div:empty,
.squire-wysiwyg div:-moz-only-whitespace {
min-height: 1em;
}
.squire-wysiwyg div:empty:before,
.squire-wysiwyg div:-moz-only-whitespace:before {
content: "Start writing here…";
opacity: 0.5;
position: absolute
}
.squire-wysiwyg, .squire-plain {
min-height: 200px;
padding: .5em;

View file

@ -283,6 +283,8 @@ const
}
} else if ( !node.querySelector( 'BR' ) ) {
fixer = createElement( doc, 'BR' );
// fixer = doc.createTextNode( ZWS );
// fixer = doc.createTextNode( NBSP );
while ( ( child = node.lastElementChild ) && !isInline( child ) ) {
node = child;
}