fix: add aria-pressed semantics to selectable Tag, remove default aria-pressed from InteractionTag #34619
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.
Previous Behavior
There were two separate issues with selected semantics on Tag and InteractionTag:
aria-pressed
defined, becausehandleTagSelect
was always defined on the parent contextselected="true/false"
did not have any selection semanticsNew Behavior
aria-pressed
set, andhandleTagSelect
defaults toundefined
instead of an empty functionaria-pressed
oraria-selected
based on parent TagGroup semantics + whether theselected
prop is a boolean and not undefinedThere is still a remaining issue that InteractionTag sets selection semantics based on
handleTagSelect
alone, and doesn't respond to directly settingselected
, which is a bit harder to fix than with Tag since the context and state types currently require it to be a boolean. This probably needs a bit more investigation (tagging @ValentinaKozlova for her opinion)Related Issue(s)