Skip to content

Datetime widget a11y #6808

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Datetime widget a11y #6808

wants to merge 8 commits into from

Conversation

Wagner3UB
Copy link
Contributor

Improved accessibility for the ‘Datetime-Widget’ component by adding an ‘aria-label’ and a translation for the ‘screenReaderInputMessage’.

PR Volto 17: #6793

@Wagner3UB Wagner3UB self-assigned this Mar 4, 2025
Copy link

netlify bot commented Mar 4, 2025

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit 79ffd95
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/67c70ddc6af1c40008862167

Copy link
Collaborator

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

A syntax change on the changelog, and a question about the message.

@@ -4835,6 +4835,11 @@ msgstr ""
msgid "private"
msgstr ""

#. Default: "Navigate forward to interact with the calendar and select a date. Press the question mark key to get the keyboard shortcuts for changing dates."
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand. How do I "navigate forward"? Is that a mouse click, tap, or keyboard shortcut?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @stevepiercy , I did not change the phrase, I just placed it inside our code to translate it into other languages. This message is read when we enter the date picker.
Screenshot 2025-03-04 alle 15 21 16

I can’t tell you what the logic behind it, it comes from the react-dates library: https://github.com/react-dates/react-dates/blob/master/src/defaultPhrases.js

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this the library we're using for a date picker? Sorry, I don't know.

See this line and its key.

https://github.com/react-dates/react-dates/blob/b7bad38dcff024d374ee98f972b55b3de9e61289/src/defaultPhrases.js#L26C7-L26C44

const keyboardForwardNavigationInstructions = 'Navigate forward to interact with the calendar and select a date. Press the question mark key to get the keyboard shortcuts for changing dates.';

We also have existing messages for what appears to be the same thing.

It has a backward counterpart in the next line.

Move backward to switch to the previous month.

Screenshot 2025-03-04 at 1 22 03 PM

I assume that navigation messages should be more descriptive and only for the icon. If so, then I'd use something like the following messages.

  • back: Tap or left arrow key to navigate backward in the calendar. On a selected date, tap or enter or return key to pick it.
  • forward: Tap or right arrow key to navigate forward in the calendar. On a selected date, tap or enter or return key to pick it.
  • info: Tap or question mark key to reveal keyboard shortcuts. Tap the close or "X" icon or the esc key to hide keyboard shortcuts.

I'm not sure whether we've adopted "tap", "press", or "click" for that gesture to satisfy both desktop and mobile UIs. Another thing for the accessibility guide! I'm also not sure whether we do anything to the names of keys to make them more accessible, such as in MyST I would do the following.

{kbd}`Return`

@davisagli
Copy link
Member

Also needs an update to the unit test snapshots

@Wagner3UB Wagner3UB changed the base branch from main to 18.x.x April 8, 2025 07:16
@Wagner3UB Wagner3UB changed the base branch from 18.x.x to main April 8, 2025 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants