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

Container block selection may be lost when window regains focus #64617

Closed
2 tasks done
stokesman opened this issue Aug 19, 2024 · 2 comments
Closed
2 tasks done

Container block selection may be lost when window regains focus #64617

stokesman opened this issue Aug 19, 2024 · 2 comments
Assignees
Labels
[Feature] Block Multi Selection The ability to select and manipulate multiple blocks [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@stokesman
Copy link
Contributor

stokesman commented Aug 19, 2024

Description

If a container block with multiple inner blocks is selected by way of the "Select all" shortcut and the window loses focus when the window regains focus the first inner block will be selected unexpectedly. The expected behavior is that the container block selection is maintained.

It’s notable that the bug doesn’t present in the following scenarios:

  • If the container block is selected by clicking the "Select parent block" toolbar button or with the breadcrumbs
  • If the container block only has a single inner block

Step-by-step reproduction instructions

  1. Using the following markup
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:paragraph -->
<p>one</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>two</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->
  1. Select one of the Paragraph blocks
  2. Use the "Select all" shortcut until the Group block is selected
  3. Switch to a different browser tab or separate window and then switch back
  4. Note the selected block has changed

Screenshots, screen recording, code snippet

container-block-selection-loss.mp4

Environment info

  • Gutenberg Trunk
  • Chrome
  • MacOS

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
@stokesman stokesman added [Type] Bug An existing feature does not function as intended [Feature] Block Multi Selection The ability to select and manipulate multiple blocks labels Aug 19, 2024
@stokesman stokesman changed the title Container block selection may be lost when window loses focus Container block selection may be lost when window regains focus Aug 19, 2024
@stokesman
Copy link
Contributor Author

I suspect this might have the same root cause as #58788.

@stokesman
Copy link
Contributor Author

This ended up resolved by #63671.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block Multi Selection The ability to select and manipulate multiple blocks [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant