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

Need example code of <Tooltip />; Only <TooltipHost /> examples are available #14516

Closed
thoffmann-fms opened this issue Aug 13, 2020 · 9 comments
Assignees
Labels
Area: Documentation Component: Tooltip Fluent UI react (v8) Issues about @fluentui/react (v8) Resolution: Soft Close Soft closing inactive issues over a certain period

Comments

@thoffmann-fms
Copy link

Describe the feature that you would like added

There are two components you can use to display a tooltip:

  • Tooltip: A styled tooltip that you can display on a chosen target.
  • TooltipHost: A wrapper that automatically shows a tooltip when the wrapped element is hovered or focused.

On page https://developer.microsoft.com/en-us/fluentui#/controls/web/tooltip please add an example of how to use the ToolTip component.

What component or utility would this be added to

https://developer.microsoft.com/en-us/fluentui#/controls/web/tooltip

@paulgildea
Copy link
Member

paulgildea commented Aug 14, 2020

Thanks for the feedback @timothyhoffmann !

And we'll take this feedback as input when we converge our ToolTip components across our two React libraries. I don't have any specific timelines to share at this time, just trying to set expectations.

Thanks!

@JustSlone
Copy link
Collaborator

@timothyhoffmann, can you elaborate on the scenario where you want to use Tooltip component directly?

The interesting logic for tooltips is in TooltipHost component (which we probably should rename to Tooltip actually). The Tooltip component is mostly just a Callout

return (
<Callout
target={targetElement}
directionalHint={directionalHint}
directionalHintForRTL={directionalHintForRTL}
{...calloutProps}
{...getNativeProps(this.props, divProperties, ['id'])} // omitting ID due to it being used in the div below
className={this._classNames.root}
>
<div

@thoffmann-fms
Copy link
Author

thoffmann-fms commented Sep 21, 2020 via email

@msft-github-bot
Copy link
Contributor

@paulgildea

Gentle ping that this issue needs attention.

@paulgildea
Copy link
Member

In reading this issue again. It sounds like the issue here is what should folks be using:

  1. Tooltip or 2. TooltipHost.

If 2, then update the documentation to steer folks to that component, If 1 and 2, then create a sample where ToolTip is used.

Is that your expectation @timothyhoffmann ?

@JustSlone
Copy link
Collaborator

So, I'm a little confused here. TooltipHost is how developers should use Tooltip. Really in most cases you just want to wrap an element to use as an anchor and have a Tooltip show when the user hovers over this element.

That's why I asked about the scenario here, @timothyhoffmann can you share the scenario you are interested in where you want to use a Tooltip component directly without the convenience of the TooltipHost? That would help understand the use case here so we can identify what is missing.

If you are looking to just simply add Tooltips, the documentation and examples cover the cases on how to use the Fluent UI Tooltip functionality.

@thoffmann-fms
Copy link
Author

thoffmann-fms commented Oct 22, 2020

Given the dearth of documentation on Tooltip I don’t know if I do want to use it or not. I don't have a scenario to use something if I don't understand what it does. If it’s really only usable internally by the developers of TooltipHost then perhaps remove the reference to ToolTip being the first item document at the top of the documentation where it's prominent:

There are two components you can use to display a tooltip:

Tooltip: A styled tooltip that you can display on a chosen target.
TooltipHost: A wrapper that automatically shows a tooltip when the wrapped element is hovered or focused.

@JustSlone
Copy link
Collaborator

Got it. I thought there was something that Tooltip was needed for that the documentation was falling short on.

Yeah, I agree that just cleaning up the documentation is the right thing to do here. We'll be updating Tooltip in the future, this issue is a good thing to keep in mind as part of that update as well. I'll add this to the epic issue.

Proposed fix:

@msft-fluent-ui-bot
Copy link
Collaborator

Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.

@msft-fluent-ui-bot msft-fluent-ui-bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label May 24, 2021
@microsoft microsoft locked as resolved and limited conversation to collaborators Jun 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: Documentation Component: Tooltip Fluent UI react (v8) Issues about @fluentui/react (v8) Resolution: Soft Close Soft closing inactive issues over a certain period
Projects
None yet
Development

No branches or pull requests

7 participants