WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.49k stars 4.19k forks source link

Create Pattern Modal: Tab focus is lost #66571

Open t-hamano opened 3 days ago

t-hamano commented 3 days ago

Description

The "Add New Pattern" modal allows us to select a pattern category that is rendered by the FormTokenField component.

When I press the tab key in this pattern category, I would expect the "Synced" toggle to get focus, but instead the modal disappears and focus is lost.

I have not been able to identify the cause, but I suspect it might be an issue that occurs when the Modal component and the FormTokenField component are used together.

This issue appears to have occurred since WP 6.4, when pattern categories were implemented.

Step-by-step reproduction instructions

Screenshots, screen recording, code snippet

https://github.com/user-attachments/assets/0d22944d-d2e4-4a74-912a-c26f0e4d5a1e

Environment info

No response

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

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

Please confirm which theme type you used for testing.