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

v5: Tooltip issue when containing HTML #31558

Closed
pboutin opened this issue Aug 31, 2020 · 11 comments
Closed

v5: Tooltip issue when containing HTML #31558

pboutin opened this issue Aug 31, 2020 · 11 comments

Comments

@pboutin
Copy link

pboutin commented Aug 31, 2020

When there are DOM nodes inside a tooltip container, the hover states of those nodes seems to conflict with the container.

Reproduced: https://jsfiddle.net/89mpekhg/1/

Steps to reproduce:

  • Hover the "Hello" part (the tooltip shows up)
  • Hover the <strong> tag (the tooltip goes away ⚠️ )
  • And on mouseleave, errors are thrown into the console (teardown of an already gone tooltip ⚠️ )

Temporary workaround:
Use the trigger: 'manual' option and handle the mouseenter and mouseleave manually.

@silviodelgado
Copy link

It happens with any tag inside tooltip target.
E.g.: a button with an icon (font-awesome or any other):
When the mouse pointer is hovering the button, tooltip is ok.
But, when the mouse pointer hovers the icon, tooltip is gone.
When mouse pointer leaves the button completely and hovers it again, tooltip is shown.

@patrickhlauke
Copy link
Member

I seem to remember this being a browser bug, or at least an unexpected spec issue.

As a possibly more robust and less invasive patch, try adding

[data-toggle="tooltip"] * { pointer-events: none; }

which makes any child element of the tooltip trigger "transparent" to the mouse, so the mouse events don't get fired/blocked by child elements

@silviodelgado
Copy link

@patrickhlauke Wow!! Nice trick! It works like a charm.
Thank you!

@silviodelgado
Copy link

silviodelgado commented Sep 1, 2020

Just one more thing:
After close a modal popup, an error is fired:

tooltip.js:343
Uncaught TypeError: Cannot read property 'destroy' of null
    at n (tooltip.js:343)
    at e.i.hide (tooltip.js:370)
    at HTMLDivElement._hideModalHandler (tooltip.js:555)
    at HTMLDivElement.n (event-handler.js:101)
    at Object.trigger (event-handler.js:326)
    at t.e.hide (modal.js:166)
    at HTMLButtonElement.<anonymous> (modal.js:143)
    at HTMLDivElement.i (event-handler.js:116)

The modal's opening is fired by a button with tooltip.

Any suggestion?

@mznet
Copy link

mznet commented Sep 2, 2020

@silviodelgado That problem is handled by the PR. It would be resolved when the pr is merged.

@silviodelgado
Copy link

@mznet Ok. Thank you!

@GilbertoDev
Copy link

GilbertoDev commented Sep 3, 2020

@pboutin
Copy link
Author

pboutin commented Sep 3, 2020

Also, calling the .dispose() function on a tooltip that has been shown at least once cause a crash.

@XhmikosR
Copy link
Member

@patrickhlauke is this the same issue as #31646?

@patrickhlauke
Copy link
Member

smells like it, yes

@XhmikosR
Copy link
Member

I'm going to close this. I don't see any errors with 5.0.0-alpha3.

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

6 participants