Repository navigation
Announce card action buttons as buttons, describe pressed actions as Selected - #5900
Draft
Eugene (OEvgeny) wants to merge 3 commits into
Draft
Eugene (OEvgeny) wants to merge 3 commits into
Eugene (OEvgeny) wants to merge 3 commits into
Conversation
Collaborator
Author
|
I'll do validation tomorrow. |
11 tasks
Eugene (OEvgeny)
force-pushed
the
OEvgeny/fix-card-action-pressed-state
branch
from
October 18, 2026 22:58
0828b3f to
dd60494
Compare
added 3 commits
October 18, 2026 17:37
The comments named Action.ShowUrl, but the code exempts buttons with aria-expanded, which is Action.ShowCard.
…Selected Card action buttons had aria-pressed, so screen readers announced them as toggle buttons that never turn off (#5716, #5719, #5745, #5750). They are now plain buttons; pressed actions are described as "Selected" via aria-describedby, which keeps the choice announced (#3622), and is styled via the adaptive-card-renderer__action--selected class instead of [aria-pressed='true'] in the default and Fluent themes.
Eugene (OEvgeny)
force-pushed
the
OEvgeny/fix-card-action-pressed-state
branch
from
October 19, 2026 00:37
dd60494 to
593accf
Compare
This branch has not been deployed
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
Changed
adaptive-card-renderer__action--selectedclass instead of[aria-pressed='true']: host CSS that targets.ac-pushButton[aria-pressed='true']should target.ac-pushButton.adaptive-card-renderer__action--selectedinstead, in PR #5900, by @OEvgenyFixed
Description
Card action buttons had
aria-pressed, so screen readers announced "toggle button, off", and a pressed button stayed "on" when pressed again, which is not how ARIA defines a toggle button. The buttons are now plain buttons. Pressed buttons are described as "Selected" througharia-describedby, so the choice is still announced (#3622), and they keep their selected style through a class.Design
aria-describedbypoints to a hidden, localized "Selected" text (new stringADAPTIVE_CARD_ACTION_SELECTED_ALT; other languages fall back to English until translated).adaptive-card-renderer__action--selectedclass in the default and Fluent themes;actionPerformedClassNameis still added next to it.[aria-pressed='true']only keeps matching if the buttons keeparia-pressed, which is what these issues report.Specific Changes
useActionShouldBePushButtonModEffect: no longer setsaria-pressed; the pressed action gets the selected class andaria-describedby; the comment now namesAction.ShowCardas the exceptionAdaptiveCardRenderer: renders the hidden "Selected" text and passes its ID and the selected class to the moddurableAddClassWithUndo: accepts space-separated class namesAdaptiveCardRenderer.module.css, FluentPartGroupingDecorator.module.css, and the deprecatedadaptiveCardRendererstyle set: the selected style uses the class instead of[aria-pressed='true']AdaptiveCardsStyleOptions:cardPushButtonBackgroundColorandcardPushButtonTextColorJSDoc describe the selected buttonuseDisabledModEffect: the comment now namesAction.ShowCardas the exceptionen-US.json: addedADAPTIVE_CARD_ACTION_SELECTED_ALTAdded
accessibility/adaptiveCard/selectedAction.html, with Fluent and Copilot variants; it also asserts thatactionPerformedClassName(several classes) is applied to the pressed actionsariaPushed.html,hack.actionShouldBePushButtonMod.html, andrichCard/heroCard.pushButton.focusVisible.html: assert the "Selected" description instead ofaria-pressedI have added tests and executed them locally
I have updated
CHANGELOG.mdI have updated documentation
Review Checklist
z-index)package.jsonandpackage-lock.jsonreviewed