Skip to content

Commit

Permalink
[a11y] Add aria-required for inputs (#8938)
Browse files Browse the repository at this point in the history
* Add aria-required for inputs

* Add for other types of inputs
  • Loading branch information
anna-dingler authored Oct 17, 2024
1 parent ffba9a6 commit cb707c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/nodejs/adaptivecards/src/card-elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3570,6 +3570,12 @@ export abstract class Input extends CardElement implements IInput {
this._renderedInputControlElement.classList.add(
hostConfig.makeCssClassName("ac-input-required")
);

if (this._renderedInputControlElement instanceof HTMLInputElement ||
this._renderedInputControlElement instanceof HTMLSelectElement
) {
this._renderedInputControlElement.setAttribute("aria-required", "true");
}
}

this._inputControlContainerElement.appendChild(this._renderedInputControlElement);
Expand Down

0 comments on commit cb707c0

Please sign in to comment.