You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Accessibility Issue - Inappropriate use of aria-pressed attribute #4469
Interactive elements need a programmatically determined name, role, and value. These properties must also be accurate and appropriate.
There are button elements where state have been used unnecessarily. This may particularly disadvantage users that interface with the accessibility properties of elements, such as screen reader and voice recognition users.
Success Criteria : -
Remove aria-pressed attribute from the source code of the buttons. For example:
JUST enough
For more information, see WAI-ARIA Practices - Toggle Button. As well, for guidance on reviewing accessibility properties, see Chrome - Accessibility properties, Edge - Accessibility Pane, and Firefox - Accessibility Inspector.
Steps to reproduce
Observe the interactive elements.
Inspect the elements and review the DOM.
Review the computed accessibility properties.
Observe that the aria-pressed is incorrectly used.
The buttons in the Adaptive Card are for making decisions. When the "JUST enough" button is clicked, a decision is being made and it will be highlighted.
When the end-user move the cursor and read the message again. The aria-pressed="true" will help them to identify which decision they had made, or in other words, which button they had clicked.
This is a screenshot from our sample:
When the button is being clicked, the button will be highlighted (in blue).
We have some early accessibility reports saying the decision (i.e. button) cannot properly identified after the button is clicked. Thus, we added aria-pressed to make them a toggle button.
I read a few WAI-ARIA articles but I could not find anything that would say the current usage is not great. There are things that I read along with excerpts:
Toggle buttons require a full press-and-release cycle to change their value. Activating it once changes the value to true, and activating it another time changes the value back to false. A value of mixed means that the values of more than one item controlled by the button do not all share the same value. If the attribute is not present, the button is not a toggle button.
Toggle button: A two-state button that can be either off (not pressed) or on (pressed). To tell assistive technologies that a button is a toggle button, specify a value for the attribute aria-pressed. For example, a button labelled mute in an audio player could indicate that sound is muted by setting the pressed state true.
While I understand the button is not exactly toggleable: once it's pushed, it's pushed and cannot be popped. The aria-pressed seems still valid to use.
Could you:
Tell us which part of WAI-ARIA, WAI-ARIA-APG or other WCAG articles we should read?
Instead of removing aria-pressed, could you tell us if there are better alternatives that we could use to indicate a decision?
Card action buttons had aria-pressed, so that the choice a user made stayed available to screen readers. However, screen readers announce such buttons as toggle buttons ("toggle button, not pressed"), although these buttons never toggle back. #5900 makes them plain buttons:
After Adaptive Cards performs an action, its button is described as "Selected" (aria-describedby) and gets the adaptive-card-renderer__action--selected class instead of aria-pressed="true".
A Submit whose inputs fail validation is not marked.
The role is now button, and the choice is still exposed, through the description (WCAG 4.1.2). Hosts with CSS for .ac-pushButton[aria-pressed='true'] should target .ac-pushButton.adaptive-card-renderer__action--selected instead. Both changes are on main and will ship in the next release.
We are closing this issue as fixed by #5900 and #5928. Please reopen if a card action is still announced as a toggle button on a build that includes them.
Activity
compulim commentedon Oct 28, 2022
The buttons in the Adaptive Card are for making decisions. When the "JUST enough" button is clicked, a decision is being made and it will be highlighted.
When the end-user move the cursor and read the message again. The
aria-pressed="true"will help them to identify which decision they had made, or in other words, which button they had clicked.This is a screenshot from our sample:
When the button is being clicked, the button will be highlighted (in blue).
We have some early accessibility reports saying the decision (i.e. button) cannot properly identified after the button is clicked. Thus, we added
aria-pressedto make them a toggle button.I read a few WAI-ARIA articles but I could not find anything that would say the current usage is not great. There are things that I read along with excerpts:
aria-pressedstateWhile I understand the button is not exactly toggleable: once it's pushed, it's pushed and cannot be popped. The
aria-pressedseems still valid to use.Could you:
aria-pressed, could you tell us if there are better alternatives that we could use to indicate a decision?compulim commentedon Jan 10, 2023
Pending for suggestions on: "what ARIA role/attributes to use for one-off decision making buttons".
OEvgeny commentedon Oct 21, 2026
Thanks for the report.
Card action buttons had
aria-pressed, so that the choice a user made stayed available to screen readers. However, screen readers announce such buttons as toggle buttons ("toggle button, not pressed"), although these buttons never toggle back. #5900 makes them plain buttons:aria-describedby) and gets theadaptive-card-renderer__action--selectedclass instead ofaria-pressed="true".The role is now button, and the choice is still exposed, through the description (WCAG 4.1.2). Hosts with CSS for
.ac-pushButton[aria-pressed='true']should target.ac-pushButton.adaptive-card-renderer__action--selectedinstead. Both changes are onmainand will ship in the next release.We are closing this issue as fixed by #5900 and #5928. Please reopen if a card action is still announced as a toggle button on a build that includes them.