Fix aria-pressed initialization for toggle buttons#42466
Open
puneetdixit200 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.
Description
Initializes missing
aria-pressedon button plugin instances from the current.activestate. Inactive toggle buttons now getaria-pressed="false", and already-active toggle buttons getaria-pressed="true"when the attribute was not present in the markup.Motivation & Context
Fixes #42328.
The button plugin already keeps
aria-pressedin sync when toggling. This covers the initial state so assistive technologies can identify the button as a toggle before the first click.Type of changes
Checklist
npm run js-lint)Tests
npm_config_cache=/tmp/bootstrap-42328-npm-cache npm run js-test-karmafailed before the implementation with the new test seeingaria-pressedasnull.npm_config_cache=/tmp/bootstrap-42328-npm-cache npm run js-test-karmareported 810/810 successful tests and exited 0. Karma also printed its existing full-page-reload shutdown warning.npm_config_cache=/tmp/bootstrap-42328-npm-cache npm run js-lintexited 0, with existing warning-comment warnings in unrelated files.git diff --checkAI assistance was used for implementation and verification. I reviewed the code and test results before submitting.