Repository navigation
Describe Adaptive Card input errors instead of naming the input with them - #6021
Merged
Merged
Conversation
added 2 commits
November 5, 2026 12:21
…them When validation fails, Adaptive Cards adds the ID of the error message to "aria-labelledby" of the input, so screen readers read the error as part of the input's name, e.g. "Role Please select the role Project Manager". It never sets "aria-invalid", and keeps the ID after the error is removed. Add an Adaptive Card mod that moves the ID of the error message to "aria-describedby", sets `aria-invalid="true"` while the error is shown, and removes IDs that point to nothing. It does nothing when Adaptive Cards does not name the input with the error. Adaptive Cards rewrites "aria-labelledby" on every validation without re-rendering, so the mod uses a new sibling of `setOrRemoveAttributeIfFalseWithUndo`, `setOrRemoveAttributeIfFalseWithUndoIfUnchanged`, whose undo restores an attribute only if it still has the value it set. Fixes #5613.
Eugene (OEvgeny)
marked this pull request as ready for review
November 6, 2026 06:49
Eugene (OEvgeny)
requested review from
William Wong (compulim),
Chris Whitten (cwhitten) and
Thomas Durnford (tdurnford)
as code owners
November 6, 2026 06:49
William Wong (compulim)
approved these changes
Nov 6, 2026
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.
Changelog Entry
Fixed
Description
Adaptive Cards puts the validation error's ID in the input's
aria-labelledby, so screen readers read "Role Please select the role Project Manager" as its name; it never setsaria-invalidand keeps the ID after the error is gone. A new card mod moves the error toaria-describedby, setsaria-invalid="true"while it is shown, and drops IDs that point to nothing. Not yet checked with Narrator or NVDA.Design
Input.getAllLabelIds()(still in adaptivecards 3.0.6); the mod does nothing once the error is no longer in the name.aria-errormessage: screen reader support is still uneven;aria-describedbyis read everywhere.aria-labelledbyin place).Specific Changes
useInputErrorShouldBeDescriptionModEffect.ts: new mod, used byAdaptiveCardRenderer.tsxsetOrRemoveAttributeIfFalseWithUndoIfUnchanged.ts: compare-and-restore undohack.inputErrorShouldBeDescriptionMod.*.html, text, toggle, multi-select: snapshot 1 error (label is the name, error the description, invalid), 2 cleared (no dangling ID);textsubmits 2×….choiceSet.filtered.html: snapshot 1, text box described by the error, invalidI have added tests and executed them locally
I have added
.changelog/<PR#>-<slug>.mdI have updated documentation
Review Checklist
z-index)package.jsonandpackage-lock.jsonreviewed