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

Tooltip bug when hovering child node #32880

Closed
vmcr opened this issue Jan 23, 2021 · 7 comments
Closed

Tooltip bug when hovering child node #32880

vmcr opened this issue Jan 23, 2021 · 7 comments

Comments

@vmcr
Copy link

vmcr commented Jan 23, 2021

Having a bunch of elements builded in this way:

<button type="button" class="btn btn-primary px-3 hasTooltip" title="Tooltip text" data-toggle="tooltip">
    <i class="fas fa-user m-0"></i>                                
</button>

<button type="button" class="btn btn-primary px-3 hasTooltip" title="Other tooltip text" data-toggle="tooltip">
    <span>Any child element</span>                                
</button>

So when I hover a tootlip target it shows the tooltip nicely. The problem is when I hover any child element of that tooltip element.

The element suddenly dissapears or is being repositioned at the top left corner of the view, breaking the entire behaviour of this Bootstrap component. No matters if it is an icon or a simply span node.

This issue isn't reproducing in earlier versions of Bootstrap.

@bpobocha
Copy link

bpobocha commented Jan 23, 2021

You can add 'pointer-events: none' to all elements inside the button. It helped me.

button *{
    pointer-events: none;
  }

@ghost
Copy link

ghost commented Jan 23, 2021

I totally agree

Tooltips are not working well with v5

@joeforjoomla
Copy link

Tooltips are not working well with BS5. If you try to enter/exit the mouse over a certain element even without any child node, the tooltip vanishes. This incorrect behavior can be seen also on the demo page using the latest Chrome: https://getbootstrap.com/docs/5.0/components/tooltips/

Definitely tooltips/popovers not working consistently with Popper 2 in BS5

@vmcr
Copy link
Author

vmcr commented Jan 23, 2021

You can add 'pointer-events: none' to all elements inside the button. It helped me.

button *{
    pointer-events: none;
  }

Well it works and I would get it running like this, but still I don't think this is the proper way to do it.

It's a bug that should be fixed in the internal code of the next release. That's why I posted here.

@ghost
Copy link

ghost commented Jan 23, 2021

@joeforjoomla
Exactly.
Especially if you hover over the SVG example then scroll down the tooltip stays there forever.

@joeforjoomla
Copy link

@Chipsum yes indeed, I'm working intensively with tooltips and popovers, but as of now they are unusable.
Moreover with BS5 it seems that it's no longer possible to have a tooltip AND a popover on the same element as i was used to do with BS2/3/4

@XhmikosR
Copy link
Member

Duplicate of #31646

@XhmikosR XhmikosR marked this as a duplicate of #31646 Jan 25, 2021
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

4 participants