Skip to content

Commit

Permalink
fix(placeholder): Show placeholder on empty paragraph, improve wording
Browse files Browse the repository at this point in the history
Fixes: #4619

Signed-off-by: Jonas <jonas@freesources.org>
  • Loading branch information
mejo- authored and backportbot[bot] committed Sep 18, 2024
1 parent 15a0d36 commit 4fb4162
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/css/prosemirror.scss
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,12 @@ div.ProseMirror {
display: block;
}

.editor__content p.is-empty:first-child::before {
.editor__content p.is-empty::before {
color: var(--color-text-maxcontrast);
content: attr(data-placeholder);
float: left;
color: var(--color-text-maxcontrast);
pointer-events: none;
height: 0;
pointer-events: none;
}

.editor__content {
Expand Down
4 changes: 1 addition & 3 deletions src/extensions/RichText.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ export default Extension.create({
LinkBubble,
this.options.editing
? Placeholder.configure({
emptyNodeClass: 'is-empty',
placeholder: t('text', 'Add notes, lists or links …'),
showOnlyWhenEditable: true,
placeholder: t('text', 'Start writing, or try \'/\' to add, \'@\' to mention…'),
})
: null,
TrailingNode,
Expand Down

0 comments on commit 4fb4162

Please sign in to comment.