Skip to content

[data grid] Custom header filter keyboard navigation issues #13734

Open
@KenanYusuf

Description

@KenanYusuf

Steps to reproduce

Link to live example: https://codesandbox.io/s/2qk4yf?file=/src/Demo.tsx (renderHeaderFilter method demo on docs)

Steps:

  1. Navigate to the "Is admin?" header filter via keyboard
  2. Press space key to open the select field
  3. Press down key and notice the focus does not change

Current behavior

The keyboard focus gets lost and does not allow me to navigate the filter options. The behaviour is also inconsistent depending on how the select field is opened:

  • In the video you can see that by opening the select field with the space key, the focus gets lost when I hit the down key.
  • Also in the video, you can see that by opening the select field with the enter key and hit the down key, the focus works as expected and I can navigate the options.
filter.header.focus.mp4

Expected behavior

The keyboard focus should be within the select field and allow me to navigate through the options

Context

I was testing issue #13702, when I noticed a similar keyboard navigation issue was apparent on the header filter demo on our documentation.

Your environment

npx @mui/envinfo
  System:
    OS: macOS 14.4
  Binaries:
    Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v18.20.2/bin/npm
    pnpm: 9.4.0 - ~/.nvm/versions/node/v18.20.2/bin/pnpm
  Browsers:
    Chrome: 126.0.6478.127
    Edge: Not Found
    Safari: 17.4
  npmPackages:
    @emotion/react: ^11.11.4 => 11.11.4 
    @emotion/styled: ^11.11.5 => 11.11.5 
    @mui/icons-material: ^5.15.21 => 5.15.21 
    @mui/internal-markdown: ^1.0.6 => 1.0.6 
    @mui/internal-test-utils: ^1.0.3 => 1.0.3 
    @mui/material: ^5.15.21 => 5.15.21 
    @mui/monorepo: github:mui/material-ui#22c5206a9e8191b2f81131d6978a0958e55b7032 => 6.0.0-alpha.11 
    @mui/utils: ^5.15.20 => 5.15.20 
    @types/react: ^18.3.3 => 18.3.3 
    react: ^18.3.1 => 18.3.1 
    react-dom: ^18.3.1 => 18.3.1 
    typescript: ^5.5.2 => 5.5.2

Search keywords: custom header filter keyboard

Metadata

Metadata

Assignees

Labels

a11yAccessibility: Issues or PRs related to making the application usable for people with disabilities.feature: Filtering on headerRelated to the header filtering (Pro) featurescope: data gridChanges or issues related to the data grid producttype: bugA bug or unintended behavior in the components.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions