Skip to content

DataViews: Patterns list: initial focus unexpectedly set on the FilterVisibilityToggle button #67726

Open
@afercia

Description

Description

When navigating with the keyboard the menu items in the DataViews navigation panel, focus is supposed to stay on the activated navigation item.

However, in the Patterns list, after navigation, focus goes to the FilterVisibilityToggle button. This is unexpected and very confusing for keyboard users.

Animated GIF to illustrate:

Image

To my understanding, #67003 introduced a fix to prevent a focus loss when removing the filters.

However, at least for me, the filters in the Patterns list are initially open. As such, focus is moved to the FilterVisibilityToggle button when it renders. I'm not sure why the filters are open in the first place. This is the only view where the filters are open by default. Anyways, the fact they are open by default is incompatible with the logic for hte focus introduced in #67003 which moves focus to the button on first render.

Cc @ntsekouras

Step-by-step reproduction instructions

  • Go to the Site editor.
  • Use the keyboard to navigate.
  • Navigate the items in the navigation panel on the left e.g. go through the Templates categories.
  • Observe that when activating one of the navigation items by pressing the Enter key, focus stays on the active item.
  • Go to Patterns and navigate the categories.
  • Observe that when activating one of the navigation items by pressing the Enter key, focus unexpectedly moves to the filters toggle button.

Screenshots, screen recording, code snippet

No response

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    [Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).[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