-
Notifications
You must be signed in to change notification settings - Fork 25
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
fix: Address validationError tooltip console for
outputs
#5088
Conversation
Thanks for the PR! 🎉 We've deployed an automatic preview for this PR - you can see your changes here:
Note The build needs to finish before your changes are deployed. |
components/inputs/input-text.js
Outdated
@@ -482,8 +482,8 @@ class InputText extends InputInlineHelpMixin(PropertyRequiredMixin(FocusMixin(La | |||
let tooltip = nothing; | |||
if (!this.skeleton) { | |||
if (this.validationError && !this.noValidate) { | |||
// this tooltip is using "announced" since we don't want aria-describedby wire-up which would bury the message in VoiceOver's More Content Available menu | |||
tooltip = html`<d2l-tooltip state="error" announced align="start" class="vdiff-target">${this.validationError} <span class="d2l-offscreen">${this.description}</span></d2l-tooltip>`; | |||
tooltip = html`<d2l-tooltip state="error" announced for="${this._inputId}" align="start" class="vdiff-target">${this.validationError} <span class="d2l-offscreen">${this.description}</span></d2l-tooltip>`; |
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 think we want this to be:
<d2l-tooltip state="error" for="${this._inputId}" align="start" class="vdiff-target">${this.validationError}</d2l-tooltip>
-
By using
for
and pointing at theinput
element, we should get the desiredaria-describedby
wire-up (byd2l-tooltip
), makingannounced
unnecessary -
The
input
will potentially already havearia-describedby
if the consumer provided adescription
or content in theinline-help
slot (see line 432 above). Thed2l-tooltip
'sfor
logic will append the tooltip id to those here. So, the offscreen description inside the original tooltip should no longer be necessary. I suspect that might have been rendered to handle the case where theannounce(...)
helper could clobber the normalaria-describedby
announcement - that would no longer be an issue. -
Previously, the announcement order was: validation message, then the offscreen description, omitting the inline-help. If we still want to omit the inline-help, then we'll need another adjustment above on line 432 if there is a validation error. Also note: the helper appends the id to the end of
aria-describedby
here in elemIdListAdd. The order of the ids inaria-describedby
might dictate the order those messages are announced. I think I checked that previously but I don't totally recall what I found. If so, and if we still want the validation message announced first, we might need to add an option to that helper so the caller can indicate whether the id should be appended to the beginning or end.
This current iteration is lacking proper accessibility when using VO+Safari For reference, the behaviour that is displayed in daylight right now via VO+Safari is also awkward but at least it say the error message eventually.
Using announced doesn't seem to fix this, which is odd because that is the only difference between what is here vs daylight in some cases? |
Pruned scope creep since attempts to address Safari + VO behaviour in middle and low verbosity were unsuccessful. Leaving it as a note here that the experience in Safari + VO for validation tooltips is just not ideal in general but would need an additional specific ticket to address as it's not a straightforward solve. |
Hmmm. That's unfortunate. I did a quick test with Safari+VO (using |
Yes that's the same observation I've gotten - the only working version I was able to come up with was modifying the following the title attribute as follows - which I was unsure if that was kosher:
|
Ok. We can run it by Jeff but I don't think we want that, since it would cause the browser's tooltip to display as well as our own. |
Circling back, had a conversation with Jeff and it was decided that since this is specific to Safari + VO AND is relevant to error tooltips and not all input tooltips that we guide to -
|
Ok, so if I understand correctly, we're going to leave the input code as-is. That is, not change require to |
Oh, one minor thing that would be good to fix up - the comment in
It sounds like Apple has fixed that "More Content Available" piece. I think I actually found the discussion thread on that last week... turns out some other people were upset about it too. Anyway, I suggest we change this comment to:
|
🎉 This PR is included in version 3.66.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
https://desire2learn.atlassian.net/browse/GAUD-7125
After reviewing all inputs that contain validationError and FormElementMixin
Action: Add
for
attribute toinput-text
, leave announced for nowI'm open to have a quick conversation about removing the use of
announced
from the elements that make use of it in theirvalidationError
tooltips--- Edit: Early attempts that spun off this PR to address this discussion point were unsuccessful