Skip to content
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

Forward deleting empty paragraph before a list (or other block types) #21558

Open
Tracked by #53305
mtias opened this issue Apr 13, 2020 · 10 comments
Open
Tracked by #53305

Forward deleting empty paragraph before a list (or other block types) #21558

mtias opened this issue Apr 13, 2020 · 10 comments
Labels
[Block] List Affects the List Block [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Bug An existing feature does not function as intended

Comments

@mtias
Copy link
Member

mtias commented Apr 13, 2020

Leave an empty paragraph and write a list after it. Now focus on the empty paragraph and do FN+Backspace. The list is lost and the content becomes paragraph. I'd expect it to just remove the empty paragraph and leave the list alone.

@mtias mtias added [Type] Bug An existing feature does not function as intended [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... labels Apr 13, 2020
@draganescu
Copy link
Contributor

I tested and can confirm this (by which occasion I also learned about fn + backspace = forward delete).

@mtias mtias added the [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable label Dec 18, 2020
@kathrynwp kathrynwp added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Aug 4, 2022
@kathrynwp
Copy link

I'm still able to replicate this with:

WordPress 6.0.1
Gutenberg 13.8.0 active or inactive
No other plugins active

I'm a longtime Mac user but also never knew about fn + backspace before!

@mtias would you like to keep this issue open or close it, since there's been no movement on it in quite a long time?

@mtias
Copy link
Member Author

mtias commented Sep 10, 2022

Yes, I was hoping the new list refactor would fix it, but appear to still be an issue

@mtias mtias added the [Block] List Affects the List Block label Sep 10, 2022
@kathrynwp kathrynwp removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Sep 11, 2022
@Mamaduka
Copy link
Member

Mamaduka commented Dec 7, 2022

@mtias, the experience should be improved after #45075.

@bph
Copy link
Contributor

bph commented Sep 15, 2023

I can still reproduce it with fn+backspace, the empty paragraph stays and the first list item is converted to a paragraph. However, if I hit backspace while focused on the empty paragraph, it removes the empty paragraph and leaves the list intact.

backspace-vs-fn-backspace.mp4

@ellatrix
Copy link
Member

ellatrix commented Oct 6, 2023

The current behaviour looks correct. Forward delete is equivalent to ArrowRight + Backspace, so that's what's happening. Also, the behaviour shouldn't change on wether or not the paragraph is empty I think. What should happen what the paragraph is not empty and selection at then end of it?

@ellatrix ellatrix added the [Status] Needs More Info Follow-up required in order to be actionable. label Oct 6, 2023
@ellatrix ellatrix changed the title Deleting empty paragraph before a list (or other block types) Forward deleting empty paragraph before a list (or other block types) Oct 9, 2023
@draganescu
Copy link
Contributor

I agree with @ellatrix that the behaviour is correct.

@mtias
Copy link
Member Author

mtias commented Oct 13, 2023

I disagree. Testing in Apple notes, forward delete is not equivalent to arrow right + backspace. If you have the following:

... caret is here on empty line ...
- One
- Two

If you do arrow right the cursor is placed at the beginning of the first list item; if you then press backspace it unindents the list. This is fine.

But if you press Fn+Backspace it doesn't do the same — it collapses the empty line and preserves the list. I'd expect the same here.

@draganescu
Copy link
Contributor

draganescu commented Oct 17, 2023

Is this the right behavior though? It's supposed to delete chars to the right (or opposite to backspace depending on lang dir)

When cursor is on empty new line it is after the invisible new line char, so forward delete removes the marker that is next, and next is the list marker.

Wikipedia says:

... forward delete, discards the character ahead of the cursor's position, moving all following characters one position "back" towards the freed letterspace.

Maybe the point of the ticket is not to fix but to enhance the behavior to emulate standard text editing conventions?

@ellatrix
Copy link
Member

Alternatively we immediately transform the next list item to a paragraph AND delete the paragraph, which is what happens now after pressing Delete twice. I thought it's nice to have an intermediate step but maybe it's weird.

For Backspace that would also mean immediately merge a list item into a paragraph instead of first "removing" the bullet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] List Affects the List Block [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

6 participants