-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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] Wrongly created initial tooltip positioning after resizing the window enough which results in scrollbars #9362
Comments
@Loktor That's a weird one! Thanks for the reproducible example. |
Looks like I faced a similar problem. In my case, it appears after switching between portrait and landscape mode. |
@mbrookes Yeah i initial was a bit confused when i found it, thought my code might be at fault, until i found out that the tooltip positioning caused the additional scrollbars^^ I think that the recalculation after the window resize might be at fault here and cause the tooltip to calculate it's position too early? sadly i didn't have time yet to take a deeper look at what might be causing this^^ |
This is a pretty interesting problem so I started off by first putting a border around the Popper injection point to see what is happening. This is why it takes a couple of hovers for it to slowly move into the right place. So I then looked for where the resize event is being handled. Tooltip.js line 142:
Which then calls react-popper and the method for scheduleUpdate is simply a reference to the scheduleUpdate function inside of Popper.js. Now, there seems to be an issue with that method when it comes to resizing windows that they have not resolved yet for window resize. Not sure much can be done until that is resolved unless anyone sees anything else here? |
@gregnb Thanks for your investigation! 👍 |
@mbrookes No problem |
In the mentioned by @gregnb Popper issue said that v1.14.2 fixes this. So, is dependency upgraded already to re-check this? |
I was playing around and tried to see what causes the scrollbars to appear for some tooltips and discovered that removing the transform property on them ( And it seems that floating-ui/floating-ui#251 does not fix the issue described by @djulen which I'm also experiencing. |
Checked, there is upgrade of the lib in v1.2.2, but still it causes problems with positioning. Actually, tooltips are broken with this update almost everywhere in our app: sometimes they are also shown behind the Dialog while actually should be inside the dialog's form. Issues with positioning described above. |
I have updated the reproduction to the latest version: https://codesandbox.io/s/rl5m5nxprq. |
Expected Behavior
After resizing my window tooltips should be repositioned correctly to avoid unnecessary scrollbars.
Current Behavior
When i resize a window to a certain point which has a tooltip at the edge then the tooltip is wrongly positioned after the resize which results in unnecessary scrollbars. After moving the mouse over the button which creates the tooltip a few times it gets into the correct position
Steps to Reproduce (for bugs)
https://codesandbox.io/s/m7p9qlpjnp
Context
It currently affects me when i resize my application (see image below) -> then scrollbars appear due to the tooltip position, which shouldn't be there. After moving over and away from the button serveral times the tooltip is positioned correctly.
Your Environment
The text was updated successfully, but these errors were encountered: