-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
packages/x-date-pickers/src/internals/hooks/useField/useField.utils.ts
Outdated
Show resolved
Hide resolved
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: ✔️
Deploy preview: https://deploy-preview-12173--material-ui-x.netlify.app/ |
packages/x-date-pickers/src/internals/hooks/useField/useField.utils.ts
Outdated
Show resolved
Hide resolved
* @param {TDate} value The given date. | ||
* @returns {number} The number of the day of the week of the given date. | ||
*/ | ||
getDayOfWeek(value: TDate): number; |
There was a problem hiding this comment.
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. 👌
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this 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 👌
Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com> Signed-off-by: Lukas <llukas.tyla@gmail.com> Co-authored-by: delangle <flaviendelangle@gmail.com>
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:
TODO
s (letterweekDay
aria-valuetext
andaria-valuenow
)selected value
described element