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] Placement initially incorrect after being updated #18790

Closed
2 tasks done
GregMeadows opened this issue Dec 11, 2019 · 4 comments · Fixed by #18813
Closed
2 tasks done

[Tooltip] Placement initially incorrect after being updated #18790

GregMeadows opened this issue Dec 11, 2019 · 4 comments · Fixed by #18813
Labels
bug 🐛 Something doesn't work component: tooltip This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@GregMeadows
Copy link

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

When Tooltip placement is updated (e.g. via a state change) the initial hover event shows the Tooltip in the wrong position, as if placement is set to -start. This is only an issue on the first hover as on subsequent hover events the Tooltip displays as expected.
Example: If set from bottom to right, the initial hover will appear as though the Tooltip is right-start.
This doesn't seem to be a issue when using Popper in a similar manner.

Expected Behavior 🤔

The Tooltip should be positioned relevent to the current placement on all hover events.

Steps to Reproduce 🕹

Code SandBox

Steps:

  1. Have an element with a Tooltip.
  2. Change the placement of the tooltip via a state change.
  3. Hover over the element.

Context 🔦

I was trying to make tooltips change from right to bottom based on a mediaQuery.

Your Environment 🌎

Tech Version
Material-UI v4.7.2
React 16.12.0
Browser Firefox, Chrome
TypeScript Yes
@oliviertassinari oliviertassinari added the component: tooltip This is the name of the generic UI component, not the React module! label Dec 11, 2019
@oliviertassinari
Copy link
Member

oliviertassinari commented Dec 11, 2019

@GregMeadows Thanks for the report. The fix proposed in #18310 also solves this problem. In case you want to give it a go, it's up for grab :)

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work good first issue Great for first contributions. Enable to learn the contribution process. labels Dec 11, 2019
@oliviertassinari oliviertassinari changed the title Tooltip placement initially incorrect after being updated [Tooltip] Placement initially incorrect after being updated Dec 11, 2019
@Amagon96
Copy link
Contributor

Hi! Can I work on this?

@oliviertassinari
Copy link
Member

You are free to go :).

@Hatzilu
Copy link

Hatzilu commented Oct 11, 2022

hey, i'm still experiencing this on mui v4.11.3, are there any hacks i could use to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: tooltip This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants