Skip to content
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

[MultiSelect]: Long options that don't fit on screen do not show hover text #9762

Closed
2 tasks done
eng618 opened this issue Sep 28, 2021 · 7 comments
Closed
2 tasks done

Comments

@eng618
Copy link
Contributor

eng618 commented Sep 28, 2021

Package

carbon-components, carbon-components-react

Browser

Chrome

Package version

latest

Description

When there is a selection in a MultiSelect that is long, the full text should show in a tooltip. Currently, that is not happening...at least by default. I did notice in the

https://react.carbondesignsystem.com/?path=/story/components-multiselect--filterable#usage

CodeSandbox example

https://codesandbox.io/s/multiselect-bug-o5gfi

Steps to reproduce

  • visit storyboard
  • open the multi-select
  • hover over 1st option that is truncated because of its length
  • here you will see there are no tooltips displayed to show the full value

The same steps can be viewed with the above CodeSandbox link as well

Code of Conduct

@tay1orjones
Copy link
Member

tay1orjones commented Oct 4, 2021

Refs #2966

Current guidance states a browser-based tooltip should be used:

Avoid having multiple lines of text in a dropdown. If the text is too long for one line, add an ellipsis (…) for overflow content, and accompany with a browser-based tooltip to show the full string of text.

This infers the use of title, but I don't know that we provide a way to set the title on the downshift items in the listbox. I think that's a minimum of what would be needed here. I'm not sure if MultiSelect ever properly handled this.

@antoinog
Copy link

antoinog commented Nov 4, 2021

Refs #2966

Current guidance states a browser-based tooltip should be used:

Avoid having multiple lines of text in a dropdown. If the text is too long for one line, add an ellipsis (…) for overflow content, and accompany with a browser-based tooltip to show the full string of text.

This infers the use of title, but I don't know that we provide a way to set the title on the downshift items in the listbox. I think that's a minimum of what would be needed here. I'm not sure if MultiSelect ever properly handled this.

7.25 Seemed to have it, as we lost the functionality on upgrading to 7.44
https://codesandbox.io/s/multiselect-bug-forked-ih9e8?file=/package.json
image

@tay1orjones
Copy link
Member

@antoinog I can't find any changes made to MultiSelect or the underlying primitives (downshift, etc) between these two versions.

Here's the full diff between tags: v10.44.0...v10.45.0

I wonder if this could be related to a change made within the browser from an update

@antoinog
Copy link

antoinog commented Nov 5, 2021

@antoinog
Copy link

antoinog commented Nov 5, 2021

@eng618 @tay1orjones
Setting useTitleInItem to true works. Pre 32 maybe this was ignored?
<MultiSelect
id="b"
useTitleInItem={true}

@antoinog
Copy link

antoinog commented Nov 5, 2021

https://react.carbondesignsystem.com/?path=/story/components-multiselect--filterable#usage
The story has a Knob to Show Tooltip on hover, which sets useTitleInItem

@tay1orjones
Copy link
Member

@antoinog Ah, yes I see that FilterableMultiSelect usage of useTitleInItem was changed slightly in #8178 v10.32.0, though I believe it's always been false by default. The change, linked here, placed the title on the span inside the checkbox wrapper. Previously it was passed directly to the Checkbox component.

Using 10.47.1 (latest) I see see the browser's title tooltip is displayed when useTitleInItem="true". Example codesandbox

Screen Shot 2021-11-08 at 9 12 25 PM

I'm going to close this as I think we've resolved the issue here, but let me know if not and we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants