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

Tooltip onhover of DetailsList item. #14760

Closed
michaeldera opened this issue Aug 26, 2020 · 3 comments
Closed

Tooltip onhover of DetailsList item. #14760

michaeldera opened this issue Aug 26, 2020 · 3 comments
Assignees
Labels
Area: Accessibility Component: DetailsList Fluent UI react (v8) Issues about @fluentui/react (v8) Resolution: Soft Close Soft closing inactive issues over a certain period Type: Bug 🐛

Comments

@michaeldera
Copy link

michaeldera commented Aug 26, 2020

Describe the feature that you would like added

I would like for an item in a DetailsList to show a tooltip when there isn't enough space to be fully visible. It allows the content on the cell to be read without the need to increase the size.

What component or utility would this be added to

Have you discussed this feature with our team, and if so, who

No

Additional context/screenshots

image

@JustSlone
Copy link
Collaborator

Given this is a common scenario and needed for accessibility, it seems reasonable to add to DetailsList.

However, as usual it's far more involved to add something like this by default for all clients of DetailsList. Therefore, in the meantime, this can be accomplished by using a custom render function and wrapping the item with a TooltipHost that has this prop: overflowMode={TooltipOverflowMode.Parent}.

Example:

// This custom Item Render function adds a TooltipHost that only shows the tooltip
// when the parent element overflows with content
function customItemRender(item) {
  return (
    <TooltipHost id={item.key} content={item.name} overflowMode={TooltipOverflowMode.Parent}>
      <span aria-describedby={item.key}>{item.name}</span>
    </TooltipHost>
  );  
}

CodePen: https://codepen.io/justslone-the-encoder/pen/bGpQdQj?editors=0010

@michaeldera
Copy link
Author

Given this is a common scenario and needed for accessibility, it seems reasonable to add to DetailsList.

However, as usual it's far more involved to add something like this by default for all clients of DetailsList. Therefore, in the meantime, this can be accomplished by using a custom render function and wrapping the item with a TooltipHost that has this prop: overflowMode={TooltipOverflowMode.Parent}.

Example:

// This custom Item Render function adds a TooltipHost that only shows the tooltip
// when the parent element overflows with content
function customItemRender(item) {
  return (
    <TooltipHost id={item.key} content={item.name} overflowMode={TooltipOverflowMode.Parent}>
      <span aria-describedby={item.key}>{item.name}</span>
    </TooltipHost>
  );  
}

CodePen: https://codepen.io/justslone-the-encoder/pen/bGpQdQj?editors=0010

Alright, this will have to do at the moment. Thank you @JustSlone

@msft-fluent-ui-bot
Copy link
Collaborator

Because this reported issue has not had any activity for over 180 days, we're automatically closing it for house-keeping reasons.

Still require assistance? Please, create a new issue with up-to date details and latest version of Fluent.

@msft-fluent-ui-bot msft-fluent-ui-bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Feb 4, 2022
@microsoft microsoft locked as resolved and limited conversation to collaborators Mar 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: Accessibility Component: DetailsList Fluent UI react (v8) Issues about @fluentui/react (v8) Resolution: Soft Close Soft closing inactive issues over a certain period Type: Bug 🐛
Projects
None yet
Development

No branches or pull requests

6 participants