-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
fix(MenuItem2): improve selected appearance and a11y #5432
fix(MenuItem2): improve selected appearance and a11y #5432
Conversation
Why is this better than the previous/existing approach? |
So, I previously thought that the currently the item in blue would have Since |
You're right. The semantics around active/selected for MenuItems has been messy for a while (there is some documentation about this in the deprecated I think we can be smarter about this going forward, make the design of MenuItems more prescriptive, and avoid adding this plumbing of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Select2 items aren't getting selected={true}
or the tick icon yet:
Also, I think Suggest2 & Omnibar menu items in the docs should not get tick icons. They behave differently, it doesn't feel necessary to visually show selection status on the items there. They should probably use the default roleStructure="menuitem"
.
they should still have
I was thinking that for a Select2, the checkmark isn't really that useful anyways-- you can only select 1 option, and you already see the selected option in the input field, so seeing a check next to that option doesn't really provide much. If you disagree, and you want it in the example, I could implement a new itemRenderer for the select2 example, sure. The consumer could always pass |
If it's not going to get the tick icon, then there shouldn't be a space here: but... I think I would prefer to add the icon, even if it's potentially redundant with the Select2 target. Some users may not show the selected item text in the target, and the tick icon can be a helpful indicator in those cases. There's a similar situation with Omnibar and Suggest2... I don't think there should be a blank space on the left since we're not showing tick icons: ... this is why I was suggesting changing the |
@bvandercar-vt I like idea 2! |
I've caused some conflicts here with the latest PR I merged #5471. If you don't mind, I'll push an update to your branch to resolve them @bvandercar-vt |
I've updated the PR with my suggestions, and an implementation of your idea (2) from your last comment. I decided to port the I think the docs examples are in a good state now: Select: MultiSelect: Suggest: Omnibar: |
Fixes #0000
Checklist
allow
liProps
to be passed toMenuItem
so that user can setaria-selected
prop.