-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Backspace doesn't (always) delete images #7422
Comments
Hi there, I tested this with Gutenberg 4.0 and was able to reproduce the issue: Tried the same with the classic editor and using backspace deleted both the text and the image. WordPress 4.9.8 and Gutenberg 4.0.0 using Google Chrome Version 70.0.3538.67 (Official Build) (64-bit) on macOS 10.14 - Mac OS Mojave |
Still an issue on 4.3. |
Still an issue. |
Still an issue. It seems like a problem with the Image block - the caret is getting stuck in the Caption rich text and pressing backspace is only considered in context of removing letters from caption text (instead of removing the block). |
To ensure that the image will be deleted when backspace is pressed in an empty caption field, we'd need to handle
A bigger question here is: should we do that? I imagine editing your caption only to remove the entire block with one extra backspace would be at least unexpected. An alternative would be deleting the block when a backspace is pressed in the succeeding paragraph (instead of moving the cursor to the caption field). This feels a bit off too - maybe selecting the image block would be the right thing to do here? I'm not sure - let's discuss. |
Hmmm... It should work similarly to the Select mode when
|
Hitting backspace when a block contains letters should delete the letters. When there is no letters left then the block should be deleted. The meta field such as caption or cite should be skipped. So that means with the above example hitting backspace should not bring one into the caption or cite area, but go to directly selecting the block. |
I see that this issue is still valid in WordPress 5.7 beta 3 and Gutenberg plugin version 10. Any thoughts on this one? |
For me there's logic in "backspace moving to the caption" because it's just the "text" that is before the removed paragraph which means it behaves like any text editor. that said, when the whole caption is emptied and you hit backspace, maybe we should remove the block? |
That seems unexpected to me. Imagine the same with a quote or table. It doesn't feel right. Maybe backspace should select the block, and the block can be deleted with a subsequent backspace? I also see that we're adding a button to add a caption for the block quote. Maybe that makes sense here too? In that case, backspace should only remove the caption. Cc @mtias. |
@ellatrix agreed on backspace at most selecting the image block in that case. |
I took a look at the RN android app and I can see backspace selects the image block, not sure where the UX diverged but from the discussion , it looks like that is the consensus @youknowriad I would love to work on this , should I work on a PR in that direction or do we need to discuss it further? |
Hey @Trapsta Jasper. If you'd like you can bring this up during tomorrows Core Editor chat (Open Floor) if you have not received any feedback by tomorrow evening and ask about it. https://make.wordpress.org/core/2022/02/28/editor-chat-agenda-march-2-2022/ (Add a comment to the agenda as it creates some additional attention.) |
@Trapsta Indeed that seems like the consensus, please free to open a PR about it ❤️ |
The current Image block does not display the empty placeholder itself if there is no caption text. Then, when you press backspace in the next block of the Image block, it will work as follows:
I feel like this is expected behavior, what do you think? 4ea01b9e6f83901a63c51821e3ea60ac.mp4 |
Agreed. |
I would like to close this issue, but please reopen if you believe that the current backspace key behavior inthe Iimage Block is not what you intended. |
Describe the bug
I can't delete images using the keyboard only when coming from below.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I'd expect the last backspace (with the image selected) would remove the image.
Instead, the cursor is stuck on the caption and backspace does nothing.
Screenshots
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: