Fix resetting menu checked state from a separate menu#76041
Fix resetting menu checked state from a separate menu#76041
Conversation
|
Size Change: +9 B (0%) Total Size: 6.87 MB
ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
tyxla
left a comment
There was a problem hiding this comment.
This tests well 👍
I also verified that the Menu story with radios works well (/?path=/story/components-menu--with-radios).
Lastly, can this use a unit test before merging?
mirka
left a comment
There was a problem hiding this comment.
Confirmed that this doesn't happen with checkbox items 👍
Reported upstream at ariakit/ariakit#5483
What?
In DataViews, the checked status of a menu option might be reset from a separate menu. Ie, sorting by Column A should reset the 'checked' status of sorting menu items from Column B. Currently, that doesn't work because whether an option is checked or not only depends on that specific menu store.
This PR fixes it by allowing
props.checkedto take priority over the menu store to decide whether a menu item should be marked as checked or not.Testing Instructions
Note: in the screenshot above, notice that the table is currently sorted by Title, so the sorting options in the Categories columns should both look as not checked.