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

fix(tooltip): tooltip flickering when hover the mouse on the border on the tooltip position #3075

Closed
CarlosTenorio opened this issue Nov 20, 2017 · 38 comments

Comments

@CarlosTenorio
Copy link

Bug description or feature request:

Tooltip flickering when hover the mouse on the border on the tooltip position.

Plunker/StackBlitz that reproduces the issue:

The Bug is reproducible on tooltip examples of: https://valor-software.com/ngx-bootstrap/#/tooltip
I'm working with Bootstap 3.3.7 but I only reproduce the bug on version 4

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 1.9.3

Angular: 4.2.5

Bootstrap: 3.3.7

Build system: Angular CLI, System.js, webpack, starter seed:

angular/cli : 1.2.0

@IlyaSurmay
Copy link
Contributor

Can't reproduce this on both versions (used chrome and firefox).

@CarlosTenorio
Copy link
Author

CarlosTenorio commented Nov 20, 2017

Chrome version: Versión 62.0.3202.94 (Build official) (64 bits)
Video Bug:
https://vimeo.com/243642568

@IlyaSurmay
Copy link
Contributor

Thanks, I reproduced it too. Strange but the flickering is only happening for tooltip on left button

@CarlosTenorio
Copy link
Author

If you zoom the page (125%) is possible reproduce when the tooltip is on top too.

@valorkin
Copy link
Member

valorkin commented Nov 23, 2017

it's and edge case :D

@zodrog
Copy link

zodrog commented Dec 8, 2017

Same issue here on Chrome latest

@danielordonez
Copy link

Same here with the latest version of Chrome

@danielordonez
Copy link

danielordonez commented Dec 12, 2017

I found that the issue is happening when the tooltip becomes visible because it overlaps the element by a bit and since the z-index of the tooltip is normally higher than the element that fires the tooltip your element hides behind it meaning that you're no longer hovering it so it hides the tooltip and it creates a hide and show loop thus giving you the flickering effect.

It has to do with the positioning that ngx-bootstrap gives to the tooltip, but you would have to move it left by 2 pixels to solve the issue, which wouldn't be the most convenient thing to do in most cases. This issue happens also to bootstrap itself, you can test it in the official bootstrap demo.

You can quickly solve this issue by setting the z-index of the element that fires the tooltip to 1071 or higher (tooltip's default is 1070)

@YevheniiaMazur YevheniiaMazur changed the title Tooltip flickering when hover the mouse on the border on the tooltip position fix(tooltip): tooltip flickering when hover the mouse on the border on the tooltip position Jan 16, 2018
@alireza-saberi
Copy link

I still have the flickering issue even after changing z-index to 1071 and above

@rokdazone
Copy link

Add "pointer-events: none;" to the tooltip css, problem solved!

.tooltip { pointer-events: none; }

@alireza-saberi
Copy link

@rokdazone this one works!
thanks

@jasonpberry
Copy link

Thanks @rokdazone !!

@kevduncan
Copy link

Adding container="body" to the element with the tooltip solved this issue for me

@fijea
Copy link

fijea commented Apr 14, 2018

@rokdazone Thanks!

@suparnavg
Copy link

What solved it for me was setting
.bs-tooltip-left CSS to {top: -12px; left: -182px;} - that is the "stable" position of the tooltip

@JoelParke
Copy link

@suparnavg Thanks!

@spernica
Copy link

This solution works, but css of the tooltip element is broken (it was moved by few pixels to the right with my left tooltip).
.tooltip { pointer-events: none; }

Much better is init all tooltips with container body in javascript.
$('[data-toggle="tooltip"]').tooltip({ container: 'body' });

@j3soon
Copy link

j3soon commented Jul 17, 2018

For me is:
.popover { pointer-events: none; }

@boazrymland
Copy link
Contributor

Be advised: in at least my version of AngularJS Material, you'll need to use
{ pointer-events: none !important; }

since the rendered tooltip has 'style' attribute on it which will override simple usage recommended above.

@skirankumar7
Copy link

.popover { pointer-events: none; }
above makes cursor not to change 'cursor hand' type.
how to handle it?

@boazrymland
Copy link
Contributor

.popover {cursor: default; }

?

mbinette91 added a commit to mbinette91/ffx2-sphere-break that referenced this issue Oct 6, 2018
When you hover over the "Solution" section's tip, it disappears (because you're not longer hovering `.box-content`) and then reappears and flickers on and off...

Thanks to @rokdazone for the [tip](valor-software/ngx-bootstrap#3075 (comment)).

Tested/Validated on Chrome.
@Domainv
Copy link
Contributor

Domainv commented Oct 9, 2018

fixed here #4660, soon will be merged

@Domainv Domainv closed this as completed Oct 9, 2018
@velrino
Copy link

velrino commented Oct 23, 2018

Stranger things!

I resolved this problem in the project I'm working on with:

.popover { pointer-events: none !important; }

@simondi
Copy link

simondi commented Dec 7, 2018

.tooltip { pointer-events: none; } solves my problem.

@MarijkeM
Copy link

I've tried all of the above solutions but nothing works for me. Are there any other suggestions? I use angular 5.0.0 and bootstrap 4.0.0 beta

@KimAlexander
Copy link

KimAlexander commented Jun 21, 2019

+ 1

@scottd98052
Copy link

Setting the container to 'body' was the fix for me.

Much better is init all tooltips with container body in javascript.
$('[data-toggle="tooltip"]').tooltip({ container: 'body' });

@Vl4t0m1c0
Copy link

Hello, I had similar problem, for me "top tooltip" was jumping 1px up and down nonstop only in chrome browser.
My fix was changing padding in component to:
.bs - tooltip - top, .bs - tooltip - auto[x - placement^="top"] { padding: 0.3rem 0; }

Code before:
.bs - tooltip - top, .bs - tooltip - auto[x - placement^="top"] { padding: 0.4rem 0; }

@onepoordeveloper
Copy link

I was facing the same problem and found out that it was because of css transition on all elements
* { transition: 0.1s; }

@sanjmeh
Copy link

sanjmeh commented Sep 11, 2019

I found that the issue is happening when the tooltip becomes visible because it overlaps the element by a bit and since the z-index of the tooltip is normally higher than the element that fires the tooltip your element hides behind it meaning that you're no longer hovering it so it hides the tooltip and it creates a hide and show loop thus giving you the flickering effect.

It has to do with the positioning that ngx-bootstrap gives to the tooltip, but you would have to move it left by 2 pixels to solve the issue, which wouldn't be the most convenient thing to do in most cases. This issue happens also to bootstrap itself, you can test it in the official bootstrap demo.

You can quickly solve this issue by setting the z-index of the element that fires the tooltip to 1071 or higher (tooltip's default is 1070)

This seems to be the root cause of my shiny hoverbox flickering too but I can't apply your suggestions on the R shiny code directly. Could someone direct me to a place where this is also explained for R shiny ggplot environment?

@denuihason
Copy link

Add "pointer-events: none;" to the tooltip css, problem solved!

.tooltip { pointer-events: none; }

It works well .... Thanks

@NataD
Copy link

NataD commented Oct 3, 2019

I have the same issue, but none of the solutions mentioned in this post helps.

@onepoordeveloper
Copy link

I have the same issue, but none of the solutions mentioned in this post helps.

Check if there are some hover effects being applied on the target element. Remove if there are..

@NataD
Copy link

NataD commented Oct 3, 2019

I have the same issue, but none of the solutions mentioned in this post helps.

Check if there are some hover effects being applied on the target element. Remove if there are..

Removing hover effects from the target element does not solve the issue.

@MathewGrg
Copy link

This worked for me. { pointer-events: none; }

@kunalturankar
Copy link

i just removed placement:"left" , this worked for me

@kavyai
Copy link

kavyai commented Jul 23, 2020

Add "pointer-events: none;" to the tooltip css, problem solved!

.tooltip { pointer-events: none; }

Above fix is not working for me because I have a link "click here "placed inside tooltip ,I'll not be able to click on the link if I'm using --pointer-events: none...

@meera1002
Copy link

Add "pointer-events: none;" to the tooltip css, problem solved!

.tooltip { pointer-events: none; }

Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests