-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(listbox): use filter tag #5952
Conversation
Deploy preview for carbon-elements ready! Built with commit d62061a |
Deploy preview for carbon-components-react ready! Built without sensitive environment variables with commit d62061a https://deploy-preview-5952--carbon-components-react.netlify.app |
Thanks @janhassel for your contribution. Do you want to resolve style dependency as well? (Note that usage of our entrypoint Sass code is not recommended for apps for performance sake)
Agreed personally, though I'd like separate issues/PRs for those
I imagine so, but I don't see it's keyboard-focusable (only programmatic-focusable) |
@@ -49,17 +48,17 @@ const ListBoxSelection = ({ | |||
}; | |||
const description = selectionCount ? t('clear.all') : t('clear.selection'); | |||
return ( | |||
<div | |||
role="button" | |||
<Tag |
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.
I think we can add the disabled
prop here so we can get the correct styles when the multiselect is disabled
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.
I was thinking that too and compared it to the current implementation where the tag styling is not changed on disable.
Personally I would also prefer to have the tag disabled since otherwise it really stands out. Do you if there was a reason behind the current implementation, like keeping it well readable for accessibility maybe?
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.
it looks like there is a slight color change on the disabled tag svg in the current multiselect, but I'm not sure if it should look like the standalone disabled tag styles cc @laurenmrice
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.
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.
Let me make a spec for this 👍🏻, will get back to you shortly
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.
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.
Thanks for the quick specs, @laurenmrice 👍
I updated the tag color for the disabled state accordingly, you can check it out in the deploy preview: https://5eaae7cd3ab6150007c0340b--carbon-components-react.netlify.app/?path=/story/multiselect--default
With a combobox specifically:
The current Carbon Filterable Multiselect component is far more complex and includes many unexpected features and interactions (which can/have proven problematic for our screen reader and keyboard users), but when triaging or remediating accessibility bugs moving forward we'll reference the WAI-ARIA Authoring Practices Guidelines for how to proceed. |
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.
-
The button is keyboard accessible 🥂. The only point of contention I have is that it's read by JAWS 2020 and NVDA as "Clear selection button" without any information about the selected items the user would be clearing by activating it.
-
There also seems to be some styling that's off in Chrome latest on Windows 10
@dakahn Thanks for catching that, I fixed the styling, should be correctly aligned now. Regarding the first point: I removed the explicit |
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.
Hey Jan, just one thing: When disabled, the tag should also be getting the disabled cursor.
@laurenmrice The issue with the |
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.
This looks good to me. thank you Jan! 👍🏻
@dakahn I'm wondering what the best strategy would be for this issue: The I see four main ways to go from here:
I'm unsure which of these options would be the best. Maybe I'm also missing an obvious one here? |
Hey @janhassel! Sorry for the delay in response, this is definitely a problem with the main widget with the button in a button. bump @dakahn again if you have any thoughts on the above questions and what we would need to do. |
First option seems like the safest path of least resistance to me. Buttons with descendant buttons make multiple appearances in our code base sadly. We can come up with ways to address any hypothetical future visual inconsistency. Refactoring to a |
related #5880 |
Ok, that sounds reasonable! Feel free to close the PR in this case. If this is an overall accessibility issue with other components as well I'd be interested in how this will be addressed. Is it something you guys have on the roadmap for v11 or later? |
Honestly, we need to rethink fundamental design decisions around element layout in a number of components with nested interactables. Buttons in buttons is a very pressing issue that we should get to way before v11 if I have my way. |
Use
<Tag />
component in ListBoxes instead of custom styles to ensure styling is up-to-date.Changelog
New
ListBoxSelection
Removed
handleOnKeyDown
in ListBoxSelection (see question below)Testing / Reviewing
Automated tests should make sure functionality isn't affected. Visually, new implementation and old implementation should look the same.
The tests are currently failing since I removed the current keydown logic. Tbh, checking out the current implementation I am a bit confused about the keyboard navigation and therefore wanted to see if that might need to be updated before re-creating it.