Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pickers] Remove clear button in tab sequence #14587

Closed
oliviertassinari opened this issue Sep 11, 2024 · 5 comments · Fixed by #14616
Closed

[pickers] Remove clear button in tab sequence #14587

oliviertassinari opened this issue Sep 11, 2024 · 5 comments · Fixed by #14616
Labels
accessibility a11y component: pickers This is the name of the generic UI component, not the React module!

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 11, 2024

Steps to reproduce

Link to live example: (required)

Steps:

  1. Open https://mui.com/x/react-date-pickers/date-picker/#clearing-the-value
Screen.Recording.2024-09-11.at.20.20.55.mov

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 #13289 (comment).

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:

  • I tab into it. In both cases, everything is selected, so pressing delete once empties the field.
  • I have just selected a value. In both cases, I select all + press delete
  • I have just selected a value. I spam the delete key, the autocomplete usually has more characters to remove, so is a bit slower.

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: -

@oliviertassinari oliviertassinari added accessibility a11y status: waiting for maintainer These issues haven't been looked at yet by a maintainer component: pickers This is the name of the generic UI component, not the React module! labels Sep 11, 2024
@michelengelen michelengelen removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 12, 2024
@michelengelen
Copy link
Member

Seems like a valid change and with good reasoning. I did add this to the board so we can sicuss further in the grooming! 👍🏼

@GBvanDam
Copy link

GBvanDam commented Oct 30, 2024

In the autocomplete, the dropdown icon is not in the tab sequence either, should the openPickerIcon be in the tab sequence, or should this one be removed from the tab sequence too? I wouldn't mind if this icon would be removed from the tab sequence too.

The only consequence it will have is that people should have the possibility to open the calendar by keyboard whilst focusing on the field. If I'm not mistaken, if you press space on the field right now, the calendar won't open. The calendar will only open when you press space whilst focussing on the openPickerIcon specifically. This might be fixed if pressing space on the field in general would open the calendar?

@LukasTy
Copy link
Member

LukasTy commented Nov 6, 2024

@GBvanDam for a widget with the dropdown role your mentioned behavior is expected, but for Pickers using a text field or a group of spinbutton elements that is not necessarily the default "norm".
We are closely following the guidelines of https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/ but native date input element does indeed open on Space click.
I will create an issue for this topic to discuss among the team. 👍

TL/DR: Yes, using Space to open the Picker makes sense, but no, I disagree with removing the open button from the tab sequence. 😉

Copy link

github-actions bot commented Nov 6, 2024

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@GBvanDam
Copy link

GBvanDam commented Nov 7, 2024

@LukasTy completely agree! Great to hear that you at least thought about it, and if I understand you correctly the open on space will be added, which is great! Thanks for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y component: pickers This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants