cms
cms copied to clipboard
Date and time formatting labels
Description
Adds visually-hidden formatting helper text to date and time fields.
Related issues
Resolves DEV-216, DEV-254
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
@gcamacho079 I’ve added dynamic human-friendly labels to those hidden span
s, 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.)
Whoops, didn’t mean to close.
@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
@gcamacho079 Alright, made that change.
Looks great, @brandonkelly!