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

Date and time formatting labels #10546

Merged
merged 11 commits into from
Aug 17, 2022
Merged

Date and time formatting labels #10546

merged 11 commits into from
Aug 17, 2022

Conversation

gcamacho079
Copy link
Contributor

Description

Adds visually-hidden formatting helper text to date and time fields.

Related issues

Resolves DEV-216, DEV-254

@linear
Copy link

linear bot commented Feb 11, 2022

DEV-216 Instruction for text input format should be provided for screen reader users

The text input type doesn't provide information about the accepted format for entering times.

DEV-254 Formatting instructions should be provided for screen reader users

# Conflicts:
#	src/fields/Date.php
#	src/templates/_includes/forms/date.twig
#	src/templates/_includes/forms/time.twig
@brandonkelly brandonkelly changed the base branch from develop to 4.3 August 15, 2022 16:39
@brandonkelly brandonkelly marked this pull request as ready for review August 15, 2022 18:46
@brandonkelly brandonkelly requested a review from a team as a code owner August 15, 2022 18:46
@brandonkelly
Copy link
Member

@gcamacho079 I’ve added dynamic human-friendly labels to those hidden spans, but only for desktop browsers at the moment. So long as mobile gets the native inputs, it seems like the formatting labels aren’t going to really be necessary?

(If we decide to switch to non-native date/time inputs for mobile, we can easily add the formatting labels at that point, but that should be done in a separate PR.)

@brandonkelly
Copy link
Member

Whoops, didn’t mean to close.

@gcamacho079
Copy link
Contributor Author

@brandonkelly just tested this and setting aria-labelledby on these inputs ended up causing some problems, as it's overriding the aria-label attribute. We should definitely move the formatting reference ID to the front of describedBy

@brandonkelly
Copy link
Member

@gcamacho079 Alright, made that change.

@gcamacho079
Copy link
Contributor Author

Looks great, @brandonkelly!

@brandonkelly brandonkelly merged commit 38ccc93 into 4.3 Aug 17, 2022
@brandonkelly brandonkelly deleted the a11y/time-field branch August 17, 2022 14:40
@gcamacho079 gcamacho079 added the accessibility 👤 features related to accessibility label Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility 👤 features related to accessibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants