You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inline styles do not persist when using Shift+Enter #1672
When pressing Shift+Enter within a block that has inline styles applied (either custom or default), the style does not carry over to the new line. Instead, the new line starts with no styling. The expected behavior is for the inline style to persist into the new line, allowing consistent formatting across line breaks as it does when pressing "Enter".
To Reproduce
Type a sentence and change the text to red
Place the cursor anywhere in the text and type Shift+Enter
Start typing - the new text is white, not red.
Intended behavior: Run these steps again and press Enter instead. This is the intended behavior, as the color persists into the new block.
You can see this behavior on the live examples in the BlockNote docs.
There are different approaches for this behavior in different editors. So I'm not so certain that it is cut & dry to say that the mark should always be preserved. For example would you expect being in bold for it to also carry over?
If the cursor is in the middle of styled text, and the user clicks "shift+enter", I would absolutely expect the style to carry over, even if it's bold.
The user is intending to stay within the current block when "shift+enter" is pressed, and therefore it would be intuitive for the styling to persist, especially if the user splits styled content into two lines, and the cursor remains in the middle of the styled content (see animated gif above). Having the font styles, color, bold... any style be suddenly removed when the user types a new character, especially when the cursor is still within the styled inline text, it would be confusing and almost always require the user to have to manually change the style again.
I find myself always reselecting the new text after clicking "shift+enter" to match the style it was before the new line was created.
You are totally right, I must've only read the description, seeing the screen recording makes it obvious that it isn't a good user experience, I've opened a PR with a change that would fix it.
Activity
nperez0111 commentedon May 9, 2025
There are different approaches for this behavior in different editors. So I'm not so certain that it is cut & dry to say that the mark should always be preserved. For example would you expect being in bold for it to also carry over?
favoffspring commentedon Jun 9, 2025
If the cursor is in the middle of styled text, and the user clicks "shift+enter", I would absolutely expect the style to carry over, even if it's bold.
The user is intending to stay within the current block when "shift+enter" is pressed, and therefore it would be intuitive for the styling to persist, especially if the user splits styled content into two lines, and the cursor remains in the middle of the styled content (see animated gif above). Having the font styles, color, bold... any style be suddenly removed when the user types a new character, especially when the cursor is still within the styled inline text, it would be confusing and almost always require the user to have to manually change the style again.
I find myself always reselecting the new text after clicking "shift+enter" to match the style it was before the new line was created.
fix: preserve marks across a shift+enter #1672
nperez0111 commentedon Jun 9, 2025
You are totally right, I must've only read the description, seeing the screen recording makes it obvious that it isn't a good user experience, I've opened a PR with a change that would fix it.
fix: preserve marks across a shift+enter #1672 (#1743)