Repository navigation
Expose current value of the lightbox duration spinbutton to screen readers - #156
Closed
stepan-kuntso wants to merge 1 commit into
Closed
stepan-kuntso wants to merge 1 commit into
stepan-kuntso wants to merge 1 commit into
Conversation
The duration input in the lightbox has role="spinbutton" but no aria-valuenow, so VoiceOver announces it as "0". Set aria-valuenow and aria-valuetext whenever the duration is recalculated.
Contributor
|
Thank you for the fix and for the clear write-up, @stepan-kuntso! We reviewed the change and accepted it. As described in CONTRIBUTING.md, this repository is generated from our internal source, so we applied the change there. It will ship in the next bugfix release (10.0.4). We will close this PR with a link to that release. Thanks again for the contribution! |
Author
|
Thank you, Alex! Glad it was useful. I'll watch for 10.0.4. |
Contributor
|
Hi @stepan-kuntso Thanks again for contributing! |
Author
|
Thank you, and thanks for extending it to the baseline durations as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is broken
In the lightbox, the duration input has
role="spinbutton"andaria-valuemin="0",but no
aria-valuenow. Safari + VoiceOver on macOS therefore announces the field as"0, Duration, stepper" even when it shows e.g. 18.
Version: 10.0.3. Browser/OS: Safari, macOS, VoiceOver.
How to reproduce
npm run build, opensamples/20_multiple/07_keyboard_navigation.html.Expected: VoiceOver announces the value shown in the field.
Actual: VoiceOver announces "0".
Cause
lightboxDurationInputAttrStringinsrc/core/ui/wai_aria.jsrenders the spinbuttonrole and
aria-valuemin, but the current value is never exposed. The value is setafter rendering (in
DurationControl.prototype.set_value), so it cannot be addedto the static attribute string.
Fix
wai_aria.js: newlightboxDurationInputValueAttr(input, value, text)that setsaria-valuenowandaria-valuetext(removed when the field is empty). Like every_waiAriamethod, it is a no-op whenwai_aria_attributesis disabled.duration_control.js: call it at the end of_calc_date, which runs when thelightbox opens, after the -/+ buttons, arrow keys, typing and date changes.
aria-valuenowis the numeric duration thatget_valuewill save;aria-valuetextis the text shown in the field, so a custom
formatter(e.g. "8 days") is read asdisplayed.
How to verify
Tested in Safari on macOS with VoiceOver, sample
samples/20_multiple/07_keyboard_navigation.html:shows 8; after — "8, Duration, stepper".
text change ("selection replaced 7"); re-reading the field (VO+F3) reports the
updated value ("17, Duration, stepper").
gantt.config.wai_aria_attributes = falseno attributes are added.npm run build,npm run lint,npm run test(128 samples) pass.Screenshots
Before:

After:
