Skip to content

Create Pattern Modal: Tab focus is lost #66571

@t-hamano

Description

@t-hamano

Note

This may only be a reproducible issue on Windows OS. Additional testing on Windows OS would be welcome.

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

  • Select "Create pattern" from a block toolbar.
  • Press the tab key repeatedly.

Screenshots, screen recording, code snippet

6c136c876db49007bb40539666fbec71.mp4

Environment info

No response

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

Labels

[Package] Components/packages/components[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions