-
-
Notifications
You must be signed in to change notification settings - Fork 78.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
v5: Bootstrap tooltips don't appear after numbers of focusing #32372
Comments
Sorry, we need more info. Please make a CodePen as per our issue template. |
I can reproduce the issue on the example linked to in the documentation. Quickly hovering over the button seems to cause this issue... To be more precise it seems as if refocusing/-hovering while the popover still transitions out leads to the behaviour. |
OK, thanks for the info. I can reproduce indeed. I believe it's a regression from the Popper 2.x update. Testing the PR preview before the Popper update seems to be fine https://deploy-preview-32280--twbs-bootstrap.netlify.app/docs/5.0/components/tooltips/#examples |
This comment has been minimized.
This comment has been minimized.
I think I pinpointed the issue. It lies in these lines: Lines 608 to 611 in b1290ff
After hovering a few times over the same tooltip, it seems that Now, I don't know if that block is even needed anymore, or if we shouldn't return from there. EDIT: I think the return there is present so that we don't show the tooltip if leave happens before the delay has passed. |
The buttons in the example work for me. However, it seems that the SVG example doesn't, neither does it on my project with child elements:
I've done a bit more testing and it seems like if you stay on the element with the tooltip(s) assigned it works, but if you then hover over the child element the tooltip breaks for that (parent) element and doesn't reappear. |
It seems the issue is caused by the popper 2.x update. I still don't get why the above happens #32372 (comment) |
Issue is that BS5 is starting to process a tooltip “leave” before the fade delay expires on the previous 'enter/show' (thus the ‘complete’ function has not been executed yet). So BS starts processing the 'leave' and the show complete occurs immediately after the leave executes its leave transition. (alternatively a show may kick off before a leave executes its complete) Depending on timing this sometimes causes the tooltip object to be deleted but the tooltip element remains in the show state. So the 'enter' and 'leave' will not execute (enter because the element says its showing and leave because the tooltip object has been destroyed). WORKAROUND: Simply add data-bs-animation='false' and everything works fine. I will leave it to you to add appropriate code to flag a previous show or hide is pending and process the new request appropriately (kill the animation event and execute the complete before processing new event or queue the events??). BTW - this is also why it fails more often where elements are nested because rapid transitions in and out of hover occur in constrained areas. |
Can confirm the above workaround from @pwagsc, I had quick hovers of the trigger element causing the tooltip to stay visible (instead of disappearing) but it appears to be related if not another result of the same issue defined in the ticket. |
Two possible solutions, both exclude many fallback tooltip placements on popper . Two branches to test it:
b) https://github.com/GeoSot/bootstrap/tree/fix-tooltip
I avoided to open PR not to mess things. If you want me to open a PR, please tell me. |
It seems like it should be possible to internally track whether or not a transition is currently in progress and if e.g. 'show' finishes while 'leave' is already fired it should not modify classes etc. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@joeforjoomla We know, that's why the issue is still opened. |
I may be wildly over simplifying this but an extra check before completing the hide transition seems to work for me RyanBerliner@c2ece10 |
@RyanBerliner can you please add a test case and if it passes submit a PR? |
I have the same issue with Bootstrap 5.0.0-beta2. As a simple workaround, I added a 100ms delay which seems to mitigate the issue, until this bug is fixed. |
I think this and #32897 may have the same root cause. |
THANK YOU!!!!!!!!! adding data-bs-animation='false' works like a charm. |
Titled problem occurs even on official docs of bootstrap website at here. Tooltips all after some hovering are disappeared and not be accessible any more.
The text was updated successfully, but these errors were encountered: