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

Tooltips: Quickly hovering over animated tooltips causes positioning to break #36875

Closed
3 tasks done
leettaylor opened this issue Aug 1, 2022 · 11 comments
Closed
3 tasks done

Comments

@leettaylor
Copy link

leettaylor commented Aug 1, 2022

Prerequisites

Describe the issue

When quickly hovering off and back onto an item with a tooltip it sometimes causes the tooltip positioning to break. This then places the tooltip at the end of the <body> and causes horizontal/vertical scrollbars to appear on the page.

If animation is disabled on the tooltips then this problem doesn't seem to occur.

Reduced test cases

Can see it in action on the Tooltips docs page. Scroll to the Directions examples and move your mouse backwards and forwards over the buttons and eventually you'll see a horizontal scrollbar appear.

If you attempt to do the same thing on the v5.1 docs page it works perfectly.

Minimal examples:

What operating system(s) are you seeing the problem on?

Linux

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

v5.2.0

@leettaylor leettaylor changed the title Quickly hovering over animated tooltips causes tooltip positioning to break Tooltips: Quickly hovering over animated tooltips causes positioning to break Aug 1, 2022
@gdbonino
Copy link

gdbonino commented Aug 1, 2022

Same here.

When broken, the tooltip's inline style is not set

@GeoSot
Copy link
Member

GeoSot commented Aug 1, 2022

Any guesses fixing it, are welcome

@tobydeieso
Copy link

From what I can tell, it looks like the tooltips hide animation callback is running out of sequence, causing it to remove the properties that were just added by the show method. In turn breaking the tooltips layout.

As a guess, it's all caused by entering the button element again, before the previous exit animation had completed.

@tungphan995

This comment has been minimized.

@mrcoco12
Copy link

I'm having the same problem, it's showing up in Bootstrap as well. A tooltip appears at the bottom of the page because inline-style has stopped working.

alt text

@samwillis
Copy link

samwillis commented Sep 24, 2022

I have just experienced this when upgrading from v5.2.0-beta to v5.2.0.

v5.2.0-beta - Not happening:

Screen.Recording.2022-09-24.at.12.46.16.mov

v5.2.0 - Bug happening:

Screen.Recording.2022-09-24.at.12.44.06.mov

Hopefully that helps in tracking it down.

@samwillis
Copy link

From an an initial look though the history (and having zero prior knowledge) I'm suspicious that this was introduced by #35679 which changed the tool tip to be fully recreated on each invocation (to fix some location bugs I think).

However, now if the old tooltip is still visible due to its animation when it is re-triggered a new one is created in its place.

I wander if the when tooltip is re-triggered during an exit animation it should use the old behaviour of using the existing element, rather than creating a new one.

I think @tobydeieso is on the right track, is it adding the styles to the old element not the new one?

@crdo
Copy link
Contributor

crdo commented Nov 1, 2022

Indeed it is related to the exit animation. If you set the animation to false, the issue disappears.

@ryanmortier
Copy link
Contributor

ryanmortier commented Nov 18, 2022

It's not just when quickly hovering either, if you slowly hover it breaks too.

Example: https://codepen.io/ryanmortier/pen/qBKVpra?editors=1010

bootstrap tooltip glitch

@charlesfries
Copy link

I believe #37235 from the 5.2.3 release fixed this

@samwillis
Copy link

Seems fixed in 5.2.3 to me, no longer reproducible in same location as my comment above.

Screen.Recording.2022-11-22.at.19.39.44.mov

@GeoSot GeoSot closed this as completed Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants