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

Select all shortcut selects all blocks instead of content in block (Microsoft Edge) #19102

Closed
grappler opened this issue Dec 12, 2019 · 13 comments
Labels
Browser Issues Issues or PRs that are related to browser specific problems [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended

Comments

@grappler
Copy link
Member

grappler commented Dec 12, 2019

Describe the bug
In Microsoft Edge the select all shortcut ctrl+A selects all blocks instead of only selecting all of the content in a block.

This is not consistent with the behaviour in Chrome and Firefox. In other browsers only when using the shortcut again are all of the blocks selected.

To reproduce

  • Click in a paragraph block
    • Press once selects all text
  • Click in another paragraph block
    • Press once selects all bocks
  • Click in another paragraph block
    • Press once selects all bocks

Expected Behaviour

  • Click in a paragraph block
    • Press once selects all text.
  • Click in another paragraph block
    • Press once selects all text
    • Press twice selects all bocks

Here is a screencast: https://youtu.be/djIfj67Qdbk

Environment

  • OS: Windows 10
  • Browser: Edge
  • Version: 18 (42.17134.1.0)
  • WordPress: 5.3
  • Gutenberg: 7.3
@MarcoZehe
Copy link
Contributor

Not only a problem in Edge, I also reproduced this in Firefox the other day.

@grappler
Copy link
Member Author

@MarcoZehe I was not able to reproduce this issue in Firefox.

Here is a short screencast of Firefox: https://youtu.be/JrSH711-37g

@MarcoZehe
Copy link
Contributor

Sorry, I am blind and cannot see the screen. So I'll take your word for it. I did reproduce it earlier this week, but when I tried just now, it worked fine. Not sure what's up with that or what condition triggers the behavior.

@talldan talldan added the Needs Testing Needs further testing to be confirmed. label Feb 4, 2020
@talldan
Copy link
Contributor

talldan commented Feb 4, 2020

@grappler Is this something you're still experiencing with the latest version of the plugin?

@grappler
Copy link
Member Author

grappler commented Feb 4, 2020

@talldan Yes, this bug is still existent. Any reason why you would expect it to be fixed?

I did notice that now the first time running "select all" in a paragraph block works fine but after that it always selects all of the blocks.

@talldan
Copy link
Contributor

talldan commented Feb 4, 2020

@grappler What you describe is how it's intended to work. Press once to select all text, press a second time to select all blocks.

As such I'll close the issue.

@talldan talldan closed this as completed Feb 4, 2020
@grappler
Copy link
Member Author

grappler commented Feb 4, 2020

@talldan But that is not the case in Edge.

Current Behaviour

  • Click in a paragraph block
    • Press once selects all text
  • Click in another paragraph block
    • Press once selects all bocks
  • Click in another paragraph block
    • Press once selects all bocks

Expected Behaviour

  • Click in a paragraph block
    • Press once selects all text.
  • Click in another paragraph block
    • Press once selects all text
    • Press twice selects all bocks

Here is a screencast: https://youtu.be/djIfj67Qdbk

@talldan talldan reopened this Feb 5, 2020
@talldan
Copy link
Contributor

talldan commented Feb 5, 2020

Thanks for the extra info @grappler, I can confirm that now that you've clarified how to reproduce the issue.

The Issue is now reopened. I've also updated the issue description with those details from your latest comment.

@talldan talldan added [Type] Bug An existing feature does not function as intended and removed Needs Testing Needs further testing to be confirmed. labels Feb 5, 2020
@ntsekouras ntsekouras added the Browser Issues Issues or PRs that are related to browser specific problems label Sep 23, 2020
@joedolson joedolson added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). and removed [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). labels Nov 27, 2020
@alexstine
Copy link
Contributor

I was able to reproduce this very confusing bug today in Firefox (latest version).

When I tried to make a selection in a block while in edit mode, every block was selected. These are the steps I followed.

  1. In select mode, navigate to a block.
  2. Enter the block using Enter, now we're in edit mode.
  3. Select all with CTRL+A.
  4. It will likely work fine since this is the first block edited.
  5. Switch back to select mode using Escape.
  6. Choose another block and press Enter to go back to edit mode.
  7. Press CTRL+A to select all and every block will select.
  8. You can also use Shift+arrows to select text and if you reach the block border, you will select other blocks at this point as well which will effectively cancel your in-block selection.

I believe this to be a major UX bug but very much an accessibility issue. If a screen reader user is editing a text field, they would expect CTRL+A to select all in the text field, not every block on the page. The whole idea that Gutenberg should flow like a Google Doc just doesn't work due to the concept of blocks themselves. Blocks are meant to have borders, restricted interaction and separation from other blocks. I would not expect the CTRL+A or Shift+arrows to select anything outside of the currently edited block unless you were in select mode. I also tested this with the setting that prevents the cursor from going in to other blocks while in edit mode and still no change.

Thanks.

@joedolson joedolson added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Nov 27, 2020
@joedolson
Copy link
Contributor

I was able to duplicate this workflow problem, as well, and agree that it's a significant accessibility problem. Being able to use Ctrl+A to select the whole set of blocks is an ability that is needed, but I would expect it to be the less common scenario. It should not be difficult to select the contents of just one block.

@draganescu
Copy link
Contributor

Notes

Investigating #30462 I found the problem here to be that:

  • we handle the Primary+A shortcut in two places, once in packages/block-editor/src/components/keyboard-shortcuts/index.js and once in packages/block-editor/src/components/writing-flow/index.js.
  • removing the keyboard shortcuts from the keyboard-shortcuts component has no effect.
  • WritingFlow has a problem in the condition that wraps the call to multiSelect in that it checks for entirelySelected.current which is manually set to true therefore always defaulting to selecting all blocks.

Updating the condition to check for:

( target.isContentEditable &&
	isEntirelySelected( target ) ) ||
( ! target.isContentEditable && entirelySelected.current )

... fixes this problem BUT does not work on list blocks or on the quote part of quotes, although it does work if the focus is in the citation. So some blocks (paragraph, image, heading, buttons) work as expected, and some don't.

Will continue to check this.

@Mamaduka
Copy link
Member

Mamaduka commented Dec 7, 2022

@talldan, can we close this issue now that #31859 is merged?

I can no longer reproduce the described behavior. Single CMD +A selects text in the block, and CMD + A + A selects all blocks.

@talldan
Copy link
Contributor

talldan commented Dec 8, 2022

Sounds good 👍

@talldan talldan closed this as completed Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser Issues Issues or PRs that are related to browser specific problems [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

8 participants