-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When pressing Enter in an H3 or other non-default text element, inline styles should not carry forward to the new paragraph tag that follows #4538
Comments
Hi Nick, I was surprised by this report because I don't see this behavior in google docs, word, etc. If you apply an inline style then you have that style continuously even if you press enter and keep typing on a new line etc. I think this is the behavior that tiptap is designed to emulate. So I'm going to remove the bug label. I am curious though to know which editors behave as you describe. It's possible this is an area where users may have varying preferences that could be supported. |
This generally happens when you have a heading and you're applying the highlight to that heading text and then press enter which converts you to paragraph format. In MS Word, if you type out a Heading 1, then change the colour, followed by pressing enter, you'll be switched back to the default colour. |
I see what you mean. Google Docs works this way too. However if you start out in ordinary text mode and hit enter it keeps the current inline style. The change occurs only when you transition to a different block element. I think this is a reasonable feature request and a possible area for a community contribution. Might be an optional behavior. Curious what @stuartromanek and @BoDonkey think. |
Not sure if you meant me @boutell! I have to say that I would expect the behavior shown in the screenshot. Instead, if you go from a heading with a span adding inline styling to a new paragraph by hitting return you end up with something like |
Good to have another take! And of course the fact that Word and Docs both do it is a big point in favor. |
Generally I think what is happening is the correct behavior, the inline style following the line break. @nicholasbester and @BoDonkey you are both describing a different behavior, one which resets any inline selections at the close of a block, which I think is reasonable and actually what MSWord and GDocs are implementing. I do lean more towards labeling that a bug |
Nick I updated the title and restored the "bug" label, would you please update your example in the description so that it clearly involves transitioning from a heading? The existing example just has paragraphs, and in that situation it's correct behavior. |
Got a fix cookin' #4541 @nicholasbester @boutell @BoDonkey |
@boutell description updated :) |
merged #4541 |
Applies to ApostropheCMS 4.2.3
To Reproduce
Step by step instructions to reproduce the behavior:
Ensure you have a
styles
within your rich text widget include inline styles effecting spans:Expected behavior
The expected behaviour is that the highlighted span shouldn't exist on the next line after "Enter" is pressed and it should revert to a default format
Describe the bug
In most rich text editors, once a user presses the enter key, they are exiting the formatting of the previous line to start a newly formatted line.
Details
Version of Node.js:
v20.13.1
Server Operating System:
MacOS X for local development and running on ApostropheCMS for staging and production
Additional context:
Happens in Google Chrome but I think this is specific to the editor. Running latest ApostropheCMS 4.2.3
Screenshots
Adding text to the display and setting it to be highlighted in orange
Pressing the "Enter" key takes me to the new line and essentially I should outside of the span of the previous line
Video
https://github.com/apostrophecms/apostrophe/assets/1872093/f8e94170-83f7-4048-bb6b-4cab8d75d195
The text was updated successfully, but these errors were encountered: