mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.08k stars 1.26k forks source link

[pickers] Remove clear button in tab sequence #14587

Open oliviertassinari opened 1 week ago

oliviertassinari commented 1 week ago

Steps to reproduce

Link to live example: (required)

Steps:

  1. Open https://mui.com/x/react-date-pickers/date-picker/#clearing-the-value

https://github.com/user-attachments/assets/fb386989-7da6-47e0-910e-8b5dbc4cb044

Current behavior

The clear button is in the Tab sequence.

Expected behavior

The clear button is not in the tab sequence.

Context

Started to discuss this in https://github.com/mui/mui-x/pull/13289#discussion_r1721293102.

In the autocomplete we ruled to not have it in the tab sequence:

It would make sense to me to do the same here for the sake of being simple to navigate inside a complex form with the keyboard. The date picker seems simpler to clear than an autocomplete:

More on this: https://scottaohara.github.io/clear-text-field-button/.

The clear button is purposefully not in the tabbing order of the web page. Keyboard users can use the Delete or Backspace keys (or first select all the text field's text and then use these keys) to delete the contents of the text field.

Your environment

npx @mui/envinfo ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```

Search keywords: -

michelengelen commented 1 week ago

Seems like a valid change and with good reasoning. I did add this to the board so we can sicuss further in the grooming! šŸ‘šŸ¼