Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions packages/core/src/editor/Block.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ BASIC STYLES
overflow: visible;
}

.bn-inline-content {
width: 100%;
}
Comment on lines -43 to -45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double checked this, the previous issue #1523 seems to still be corrected with this in-place


/*
NESTED BLOCKS
*/
Expand Down Expand Up @@ -542,15 +538,13 @@ NESTED BLOCKS
}

/* PLACEHOLDERS*/
.bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before {
/*float: left; */
pointer-events: none;
height: 0;
/* width: 0; */
position: absolute;
.bn-block-content:has(.ProseMirror-trailingBreak:only-child):after {
font-style: italic;
/* Removes text cursor offset. */
margin-inline: -2px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to be able to show the text cursor underneath the placeholder.

There may be a way around this, by adding data attributes to make the width of the flex layout different based on whether the placeholder is showing or not.

But, doesn't seem to cause issues, may revisit if it does something weird

pointer-events: none;
max-width: 100%;
}
/* TODO: should this be here? */

/* TEXT COLORS */
[data-style-type="textColor"][data-value="gray"],
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/extensions/Placeholder/Placeholder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const PlaceholderExtension = createExtension(
const styleSheet = styleEl.sheet!;

const getSelector = (additionalSelectors = "") =>
`.${uniqueEditorSelector} .bn-block-content${additionalSelectors} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`;
`.${uniqueEditorSelector} .bn-block-content${additionalSelectors}:has(.ProseMirror-trailingBreak:only-child):after`;

try {
// FIXME: the names "default" and "emptyDocument" are hardcoded
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/editor/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
}

/* Placeholder styling */
.bn-inline-content:has(> .ProseMirror-trailingBreak):before {
.bn-block-content:has(.ProseMirror-trailingBreak):after {
color: var(--bn-colors-side-menu);
}

Expand Down
Loading