-
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
feat(list-box): update selection style #4753
feat(list-box): update selection style #4753
Conversation
Deploy preview for the-carbon-components ready! Built with commit 091be2f https://deploy-preview-4753--the-carbon-components.netlify.com |
Deploy preview for carbon-elements ready! Built with commit 091be2f |
Deploy preview for carbon-components-react ready! Built with commit 091be2f https://deploy-preview-4753--carbon-components-react.netlify.com |
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.
-
Make sure we are using the 16px icon for chevron and the checkmark.
-
Hover and selected states look like the same color. Should be using
hover-ui
for hover andselected-ui
for selected
-
Inline listbox in vanilla and inline dropdown in react: The checkmark icon should be vertically aligned with the chevron icon. Right now it’s too far left.
-
The checkmark icon looks like the wrong color in the dark themes. It should be calling
icon-01
-
Combobox is getting a secondary invalid border when it is set to invalid and disabled.
-
When we have overflow content inside an item that is selected, we need to still keep enough padding on the right hand side to allow space between the ellipses and to keep the checkmark aligned vertically with the chevron. Right now the checkmark icon is overlapping the ellipses.
Needs to look like this:
Hey @asudoh! 👋 This looks like an enhancement PR, I think as a group we're tackling fixes through end of year (in particular accessibility) Would be great to focus our attention on those and reserve these types of PR for the new year 👍 |
Seems that the referring issue (#3988) is an attempt to address the color contrast issue with selected dropdown item. @laurenmrice Any thoughts on the highlights? Thanks! P.S. for @laurenmrice will take a look the comments next week. |
Thanks again @laurenmrice for reviewing!
|
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 is still something odd going on with the hover and selected states. Here is an example of when something is already is selected it gets a lighter hover change if you move the cursor on that selected item. Then when you hover to an item that is not selected it still gets the same color as the selected item.
-For long strings of text with ellipses, can we have 16px padding on the left and right before and after the checkmark, and when there is no checkmark present have 48px? Right now the elipses going full line and then changing to shorten even more when selected with the checkmark gets jumpy.
Thanks @laurenmrice for another round of review! Fixed the right margin and the background color of the selected item. |
@laurenmrice how should this behave if scrollbars are enabled? Was running into: |
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.
Looks great! Just had the one question with scroll bars
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.
Vanilla and React
- The rules separating the items in the dropdown is getting cutoff on the right. they should be the same distance away as they are on the left.
To joshs comment: Checkmark should still stay vertically aligned with chevron if there is a scrollbar. would rather always have them in place instead of them jumping around.
@laurenmrice I'm not sure if that is do-able in CSS as we don't know if a fixed scrollbar is being displayed, or not since it's an OS-level setting. I think we also will run into this with Windows/Edge, and the scrollbars themselves may have variable width (e.g. 15 vs 16px for macOS vs Windows) |
@joshblack sorry for delayed response, have been consumed by patterns project. just curious, do you know how often people keep scrollbars persistant? just trying to guage how often this kind of scenario would occur |
@laurenmrice it tends to come up for Windows/Linux users and for folks who have a mouse connected to their Mac through a USB (not a trackpad). I personally fall under that last situation, for example, since I always use a mouse when at work/at home. |
bump @laurenmrice if you have a sec! |
@joshblack oh ! sorry for delayed response on this. im going to discuss this with design tomorrow to get a consensus. 👍🏻 |
@joshblack https://opensource.adobe.com/spectrum-css/components/dropdown/ adobe is treating the select state of a dropdown similarly to what we are trying to accomplish. Could you test to see how their checkmark adjusts with a persistent scrollbar in the scenarios you are talking about? (i don't use a mouse or have one with a usb) |
@laurenmrice for sure! So for people on Windows/Linux and for those on Mac with a mouse wheel they'll end up seeing this version when it overflows 😞 |
Thanks Josh for trying that out ! I would like to see if @asudoh could tryout some ways to see if it is possible to keep the checkmark inline with the chevron even if scrollbars are enabled. If he ends up finding its def not possible to keep them aligned in that scenario, then we can go this route. |
@laurenmrice Thank you for clarifying the goal you had in mind. I used to work on a logic of detecting if there is a scroll bar or not, and found out that it's error-prone and has performance problems. |
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.
Ok if thats the case from that issue that trying to align things with enabled scrollbars is finicking and my not be a consistent experience then we can just leave it.
A couple more changes though:
- The rules separating the items needs to be 16px away from the right hand side. Right now they are too short.
- Double check to make sure we are using the right checkmark icon from elements. https://carbon-elements.netlify.com/icons/examples/preview/#16%2Fcheckmark
Thank you for your review @laurenmrice! Fixed dropdown item border. Wrt checkmark icon, confirmed that checkmark/16 is used. |
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.
So everything regarding the new selection state looks good for listbox, dropdown, combobox in vanilla and react. (However I see lots of bugs with these components in other aspects in Vanilla. I can make separate issues for those.)
Cool thanks @laurenmrice for reviewing! Don't hesitate to file other bugs you found! |
Fixes #3988.
Refs #4376.
Changelog
New
Testing / Reviewing
Testing should make sure combo box and dropdown are not broken.