Initialize aria-pressed for toggle buttons#42713
Open
Kevinjohn wants to merge 1 commit into
Open
Conversation
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.
Toggle buttons initialized without
aria-pressedare not exposed as toggle buttons to assistive technologies until their first activation.Description
aria-pressedvalue from the button's current.activestate.aria-pressedvalue.Motivation & Context
Fixes #42328.
Observable sequence:
data-bs-toggle="button".aria-pressed="false"andaria-pressed="true", matching each element's initial state.This replaces #42466 with a focused change based on current
mainand expands coverage for explicit author-provided values.Type of changes
Checklist
pnpm run js-lint)Actual screenshots
Before (current
main): the regression test receivesnullinstead of the expected initial ARIA state.After (this PR): the same Chrome Headless run reports 810/810 successful tests.
Validation
pnpm exec karma start js/tests/karma.conf.js --single-run: 810/810 successfulpnpm run js-lint: passes with 18 pre-existing warning-comment warningsgit diff --checkThe local Karma process prints its existing full-page-reload shutdown warning after the test result.
Related issues