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

[fields] Add a11y support to multi-HTML field #12173

Merged
merged 263 commits into from
Feb 23, 2024

Conversation

LukasTy
Copy link
Member

@LukasTy LukasTy commented Feb 22, 2024

Re-create flaviendelangle#27.

Part of #6384.

Based on https://www.w3.org/WAI/ARIA/apg/patterns/spinbutton/examples/datepicker-spinbuttons/ guidelines.

P.S. Sorry for the noisy commit history.
The branch was created from a sub-branch, which has been squash-merged. 🙈

Future improvements:

  • Handle the added TODOs (letter weekDay aria-valuetext and aria-valuenow)
  • Add a11y specific test coverage
  • Improve readOnly behavior (screen reader)
  • Add hidden selected value described element

@LukasTy LukasTy added accessibility a11y component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature feature: Keyboard editing Related to the pickers keyboard edition labels Feb 22, 2024
@LukasTy LukasTy self-assigned this Feb 22, 2024
@mui-bot
Copy link

mui-bot commented Feb 22, 2024

Localization writing tips ✍️

Seems you are updating localization 🌍 files.

Thank you for contributing to the localization! 🎉 To make your PR perfect, here is a list of elements to check: ✔️

  • Verify if the PR title respects the release format. Here are two examples (depending if you update or add a locale file)

    [l10n] Improve Swedish (sv-SE) locale
    [l10n] Add Danish (da-DK) locale

  • Update the documentation of supported locales by running yarn l10n
  • Clean files with yarn prettier.

Deploy preview: https://deploy-preview-12173--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against b4158d4

* @param {TDate} value The given date.
* @returns {number} The number of the day of the week of the given date.
*/
getDayOfWeek(value: TDate): number;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've for now removed the reliance of this method because we can't reliably parse the value in a range field.
IMHO, the method makes sense, but we can remove it for now if you think it's better to limit the scope. 👌

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is missing for your to be able to parse the value in a range field?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Knowing which value from the array is the relevant one.
Even then, until such value is set, we'd need an alternative way of getting the day of the week from the section value. 🤔

* @param {TDate} value The given date.
* @returns {number} The number of the day of the week of the given date.
*/
getDayOfWeek(value: TDate): number;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is missing for your to be able to parse the value in a range field?

Copy link
Member

@flaviendelangle flaviendelangle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge and fine tune later 👌

@LukasTy LukasTy merged commit 128dcd6 into mui:next Feb 23, 2024
17 checks passed
@LukasTy LukasTy deleted the multi-html-field-a11y branch February 23, 2024 09:45
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! enhancement This is not a bug, nor a new feature feature: Keyboard editing Related to the pickers keyboard edition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants