-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
bug: unable to remove header formatting in a specific scenario #5637
Comments
Hi @patrickcate, does clicking the header button again while at the end of the test works? If not can you share a quick video or a step by step reproduction of what you're trying to accomplish? |
@erezrokah, yes clicking on the header again while at the end of the text does work. Didn't know that was possible. It's good to know there is a way to remove the styling without having the go into the raw markdown editor mode, but I think it would be more intuitive if this also functioned when the text was highlighted and/or the cursor was inside the text. |
It should. Are you experiencing a different behavior? If so can you post a reproduction? |
OK, just tested (I'm just using the Netlify CMS demo site). It does work when the cursor is inside the text or you've select some text inside, but doesn't work when you select the entire line by triple clicking the text. |
Here's a video showing the issue. When I'm selecting the entire line I'm triple clicking the text. netflify-cms-header-dropdown.mov |
Thanks @patrickcate, I updated the issue title to match the video |
Hello @erezrokah , I know the reason for the issue. When clicking the Heading button, for example Heading 1, we call the This makes sense on paper, but the problem lies with triple click action in the Slate editor. Instead of the selecting just one block, internally it selects all the subsequent block. This means Meanwhile, the UI indicates that only one block is selected, which leads to the confusion. The issue is well-documented here. What do you suggest?
|
Thanks @bytrangle, that makes sense.
I think this would be preferable, depending on the size of the effort.
I've added this to #5652 |
Good question. Interestingly, the List and Quote blocks are not affected because they are handled by different methods that use a different logic. For example:
If you triple click Heading 1, the selection will be Then click either List or Quote button. The In contrast, when clicking a Heading button, we look for If
You may wonder: How about the paragraph block after I don't know why it behaves that way, but this is probably a reason why this triple-click issue has flown under the radar for so long. But thanks to your inquiry, I think I've discovered an economical way to resolve this issue. |
@erezrokah While investigating the triple-click issue, I encounter this: I thought the expectation is to have both blocks be list items? |
You're correct. This seems like a separate bug. |
Has there been an issue filed for that? I've searched, but it's not easy to find the right keywords for these issues so I may have missed it. If there's none, I'll create one tomorrow and work on that one first. |
There isn't! I should have mentioned it.
That would be great, thank you |
Is your feature request related to a problem? Please describe.
In the markdown editor toolbar, there is no easy way to remove heading level stylings once applied. From what I can tell, the only way to remove a heading level styling from text is to switch to the raw markdown mode and remove the
#
formatting there.Describe the solution you'd like
Add a toolbar option to remove a heading styling if applied to selected text. I can thing of 3 ways this could be implemented.
The text was updated successfully, but these errors were encountered: