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

Unable to delete selected blocks using the keyboard #41416

Closed
markhowellsmead opened this issue May 28, 2022 · 12 comments
Closed

Unable to delete selected blocks using the keyboard #41416

markhowellsmead opened this issue May 28, 2022 · 12 comments
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Accessibility Feedback Need input from accessibility [Package] Block editor /packages/block-editor [Type] Regression Related to a regression in the latest release

Comments

@markhowellsmead
Copy link

markhowellsmead commented May 28, 2022

Description

Until WordPress 6.0, it was possible to delete selected blocks in the editor using the delete button / backspace button on the keyboard. This is no longer possible, thereby decreasing the usability of the keyboard for editor navigation.

Step-by-step reproduction instructions

  1. Select some blocks (see also Keyboard shortcut for selecting text across multiple blocks is missing #41168 for a related issue)
  2. Try to remove the blocks using the backspace or delete key on the keyboard.

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 6.0 without Gutenberg plugin.

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@Mamaduka Mamaduka added [Type] Regression Related to a regression in the latest release [Package] Block editor /packages/block-editor labels May 28, 2022
@skorasaurus skorasaurus added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Accessibility Feedback Need input from accessibility [Status] Needs More Info Follow-up required in order to be actionable. labels May 28, 2022
@skorasaurus
Copy link
Member

skorasaurus commented May 28, 2022

likely related to #38892

I'm not quite sure what the disadvantage that you're experiencing is:

On 5.x without Gutenberg installed: if your cursor was 3-4 lines in a 8 line block, shift + down would select each subsequent line of the block and when you came to the end of the block, it would select the entire block, and if you pressed shift+down once more, it would select all of the the adjacent block as shown in the following video

2022-05-27-gutenberg.mp4

You could then press the delete or backspace button and all of the content in both blocks would be deleted.

On 6.x without Gutenberg installed (which likely has #38892 included);

I can still delete multiple, consecutive rich text-based blocks now; I just now start at the beginning of the first block. You can relatively quickly go to the beginning of that block's content by pressing the home button on the keyboard and then pressing up or down as you desire and continuing to press shift and down until selecting all of the second block's content; and then I was able to press delete to erase the block's content as indicated in the video below. (alternatively, you could reach the beginning of a block by pressing control + home, although that is likely unintended behavior - ref #8353)

2022-05-27-gutenberg-2-.2.mp4

Does this behavior not match what you're experiencing? If it does, How would you suggest to improve this behavior?

@Julianoe
Copy link

My end users have been describing comparable issues with the delete key. I'm still trying to corner what is the exact behavior causing problems.

@markhowellsmead
Copy link
Author

markhowellsmead commented May 30, 2022

Thanks for the explanation, @skorasaurus. When I'm in a text-based block, using shift-up allows me to select text line-by-line. I can then use delete for the current block (not the current text selection) or backspace just for the current selection. Although this is different to previous versions, and requires users to experiment in order to find out the new behaviour, it seems to be logical.

After selecting a columns block and then using shift+up to select as far as the middle of a preceding text block, using the delete button doesn't delete anything; it highlights/selects the whole of the columns and text block in which the cursor is currently positioned. This is incorrect - it should delete any completely selected blocks and the part of the text block which was highlighted.

Partially selecting in this way outside the Gutenberg editor (e.g. in another OSX app) and then typing without deleting removes what was formerly selected, and allows for continued typing immediately.

Using shift+down to select text in a text block stops at the end of the final text block. It is no longer possible to use the keyboard to start a selection in the middle of a text passage and then continue into the adjacent (e.g. image, columns) block, with the subsequent intention of deleting multiple blocks.

Using the "home" button on the keyboard (OSX) moves me to the start of the current row within a text block, not to the beginning of the block.

@markhowellsmead
Copy link
Author

On 5.x without Gutenberg installed: if your cursor was 3-4 lines in a 8 line block, shift + down would select each subsequent line of the block and when you came to the end of the block, it would select the entire block, and if you pressed shift+down once more, it would select all of the the adjacent block as shown in the following video

This would be the expected outcome except for the fact that now, with the integration of multiline selection, reaching the end of a text block should not automatically select the entire block. It should be possible to start the selection in the middle of a paragraph and continue into subsequent media/columns/etc. blocks using the keyboard.

@ntsekouras ntsekouras added the [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... label May 31, 2022
@skorasaurus
Copy link
Member

skorasaurus commented May 31, 2022

Thank you for the responses @markhowellsmead

Thanks for the explanation, @skorasaurus. When I'm in a text-based block, using shift-up allows me to select text line-by-line. I can then use delete for the current block (not the current text selection) or backspace just for the current selection. Although this is different to previous versions, and requires users to experiment in order to find out the new behaviour, it seems to be logical.

Interesting, this behavior is different than it is for me; what happens for me (and what is the intended behavior - I think, not 100%) is that when a current text selection (and is highlighted) and then you press delete or backspace, only the current text selection is deleted. It sounds like for you, the entire block and all of its content, even if it is not selected and highlighted, is deleted. Do you have the same results when you press backspace as you do when you press delete?

What operating system (and version) and web browser are you using? OSX?

After selecting a columns block and then using shift+up to select as far as the middle of a preceding text block, using the delete button doesn't delete anything; it highlights/selects the whole of the columns and text block in which the cursor is currently positioned. This is incorrect - it should delete any completely selected blocks and the part of the text block which was highlighted.

I can reproduce this as well and is, to me, also unexpected behavior; I'll make a ticket for this shortly - #41467

Partially selecting in this way outside the Gutenberg editor (e.g. in another OSX app) and then typing without deleting removes what was formerly selected, and allows for continued typing immediately.

Using shift+down to select text in a text block stops at the end of the final text block. It is no longer possible to use the keyboard to start a selection in the middle of a text passage and then continue into the adjacent (e.g. image, columns) block, with the subsequent intention of deleting multiple blocks.

(will finish this up later)

Using the "home" button on the keyboard (OSX) moves me to the start of the current row within a text block, not to the beginning of the block.

This is the same behavior for me on Linux; Using control + Home will move me to the beginning of the block.

@markhowellsmead
Copy link
Author

what happens for me (and what is the intended behavior - I think, not 100%) is that when a current text selection (and is highlighted) and then you press delete or backspace, only the current text selection is deleted. It sounds like for you, the entire block and all of its content, even if it is not selected and highlighted, is deleted. Do you have the same results when you press backspace as you do when you press delete?

No, the result is different, as explained above.

What operating system (and version) and web browser are you using? OSX?

Brave (Chromium) on OSX (12.4).

Using the "home" button on the keyboard (OSX) moves me to the start of the current row within a text block, not to the beginning of the block.
This is the same behavior for me on Linux; Using control + Home will move me to the beginning of the block.

I'd say that the chances are slim for a regular user finding this out. The regular behaviour in OSX outside Gutenberg is that the home button jumps to the top of the page, so this modification in Gutenberg isn't an established interaction pattern.

@skorasaurus skorasaurus removed the [Status] Needs More Info Follow-up required in order to be actionable. label May 31, 2022
@skorasaurus
Copy link
Member

what happens for me (and what is the intended behavior - I think, not 100%) is that when a current text selection (and is highlighted) and then you press delete or backspace, only the current text selection is deleted. It sounds like for you, the entire block and all of its content, even if it is not selected and highlighted, is deleted. Do you have the same results when you press backspace as you do when you press delete?

No, the result is different, as explained above.

What operating system (and version) and web browser are you using? OSX?

Brave (Chromium) on OSX (12.4).

Excellent, this is (at least) one bug then! Could you share if you also experience this on chrome and firefox?

I'd say that the chances are slim for a regular user finding this out. The regular behaviour in OSX outside Gutenberg is that the home button jumps to the top of the page, so this modification in Gutenberg isn't an established interaction pattern.

This is tricky because this pattern vary across operating systems:

It is a common shortcut where in linux; home takes you the beginning of the line and control + home takes you to the beginning of the document (sublime, gedit, MS Visual Studio Code; and bash, and google docs) all use this.
I understand though, just because some other programs use that shortcut, Gutenberg shouldn't necessarily adopt that without consideration.

Related bug for this #8353

@markhowellsmead
Copy link
Author

when a current text selection (and is highlighted) and then you press delete or backspace, only the current text selection is deleted. It sounds like for you, the entire block and all of its content, even if it is not selected and highlighted, is deleted. Do you have the same results when you press backspace as you do when you press delete?

After cross-checking all current browsers, including Safari, it seems that I was mistaken. Using the delete button or the backspace button only deletes text which has been selected. The other issues, including cross-boundary selection, remain.

@Julianoe
Copy link

Julianoe commented Jun 2, 2022

Does the cross-boundary selection you face is what I described in this other issue about the Classic block ? #41432

@markhowellsmead
Copy link
Author

@Julianoe I expect it's related in some way.

@mrfoxtalbot
Copy link

mrfoxtalbot commented Mar 27, 2023

I am unable to reproduce this. I can delete blocks by pressing backspace and/or delete.

This is probably related to #49217

@annezazu
Copy link
Contributor

I can't replicate this either. I'm going to close out for now but please let me know if the problem can be replicated and reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Accessibility Feedback Need input from accessibility [Package] Block editor /packages/block-editor [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

No branches or pull requests

7 participants