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

RichText 'steals' back the focus after using the select all command #58788

Open
Mamaduka opened this issue Feb 7, 2024 · 1 comment
Open
Labels
[Feature] Block Multi Selection The ability to select and manipulate multiple blocks [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Bug An existing feature does not function as intended

Comments

@Mamaduka
Copy link
Member

Mamaduka commented Feb 7, 2024

If you run the select all command inside the RichText, then immediately select the non-text block, the focus will return to the RichText component.

Gutenberg version - current trunk (bc3f367).

Steps to reproduce

  1. Open a post or page.
  2. Insert any block that uses the RichText component - Heading.
  3. Insert non-text block - Image.
  4. In the heading block, use select all command - CMD+A.
  5. Select the image block.
  6. Selection will move back to the Heading block.

Screencast

CleanShot.2024-02-07.at.21.52.22.mp4
@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Feature] Block Multi Selection The ability to select and manipulate multiple blocks labels Feb 7, 2024
@Mamaduka
Copy link
Member Author

Mamaduka commented Apr 5, 2024

I believe the selection change is triggered by the useSelectionObserver hook.

@ellatrix, any thoughts on how we can avoid this behavior?

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 [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

1 participant