-
Notifications
You must be signed in to change notification settings - Fork 622
Correct inactive ActionList.Item behavior in NavList and SelectPanel contexts #5866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
aa6c046
changes messages for inactive ActionList items to never render in a t…
mperrotti 699c387
changes inactive items to be labeled by item label and described by i…
mperrotti fc68413
Merge branch 'main' of github.com:primer/react into mp/fix-inactive-a…
mperrotti e373ebf
reverts SelectPanel story I was using for testing
mperrotti 7160b3c
adds changeset
mperrotti bfecc3e
Merge branch 'main' into mp/fix-inactive-actionlist-bugs
francinelucca 3d61c16
shortens changeset
mperrotti a86e983
Merge branch 'mp/fix-inactive-actionlist-bugs' of github.com:primer/r…
mperrotti 8519795
test(vrt): update snapshots
francinelucca f2c0a21
clearer error message when trying to use a TrailingAction inside of a…
mperrotti fc1292e
Merge branch 'mp/fix-inactive-actionlist-bugs' of github.com:primer/r…
mperrotti bf59ad4
Merge branch 'main' of github.com:primer/react into mp/fix-inactive-a…
mperrotti 075695f
go back to checking 'container' value instead of 'listRole' value for…
mperrotti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
'@primer/react': patch | ||
--- | ||
|
||
- Instead of relying on parent component checks (e.g. “is this `ActionList` wrapped in an `ActionMenu` or `SelectPanel`?”) to decide between a tooltip or inline inactive message, we now check the `role` on `ActionList`. | ||
- If `role` is `"menu"` or `"listbox"`, the inactive message is rendered inline (e.g. in `ActionMenu` or `SelectPanel`) | ||
- Otherwise, the message is shown in a tooltip | ||
- This `role`-based logic fixes inactive NavList item behavior: | ||
- Now shows the message in a tooltip instead of inline | ||
- This `role`-based logic fixes inactive SelectPanel item behavior: | ||
- Now shows the message inline instead of in a tooltip | ||
- **Important note:** Inactive text only works in `SelectPanel` items when using the modern `ActionList`. The deprecated `ActionList` does not support inactive items. | ||
- Uses the same `role`-based logic to determine whether `ActionList.TrailingAction` is allowed inside an item | ||
- Previously, we relied on parent component checks to block nesting interactive elements | ||
- This change is unrelated to inactive states, but it's a more robust way to prevent interactive conflicts | ||
- Updates `aria-describedby` and `aria-labelledby` associations for tooltip buttons on inactive items: | ||
- **Before**: `aria-describedby` → item label ("Item 1"), `aria-labelledby` → inactive message ("Unavailable due to an outage") | ||
- **After**: `aria-labelledby` → item label, `aria-describedby` → inactive message | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.