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 when hovering a child element (delegateTarget) #30928

Merged
merged 4 commits into from
Jun 18, 2020

Conversation

tkrotoff
Copy link
Contributor

@tkrotoff tkrotoff commented May 29, 2020

@@ -81,6 +81,17 @@ And with custom HTML added:
</button>
{{< /highlight >}}

With an SVG:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allows to test/demonstrate inside documentation, should be done another way I guess.

Without the delegateTarget fix, it does not show the tooltip when hovering and crashes when mouse leaving.


spyOn(tooltip, 'show')

tooltipEl.querySelector('rect').dispatchEvent(createEvent('mouseover', { bubbles: true }))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bubbles: true is important here, otherwise it won't work

@tkrotoff tkrotoff force-pushed the tooltip-delegateTarget branch 4 times, most recently from 67a9192 to b544f08 Compare June 3, 2020 13:49
@XhmikosR XhmikosR requested a review from Johann-S June 4, 2020 09:01
@mdo mdo changed the base branch from master to main June 16, 2020 19:33
@XhmikosR
Copy link
Member

@Johann-S can you have a look please? I think this should fix #31080

@isteiger
Copy link

I tried this fix, it does fix that bug

Copy link
Member

@Johann-S Johann-S left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work !
LGTM 👍

@XhmikosR XhmikosR merged commit d80a9fc into twbs:main Jun 18, 2020
@XhmikosR XhmikosR changed the title Fix tooltip when hovering a children element (delegateTarget) Fix tooltip when hovering a child (delegateTarget) Jun 21, 2020
@XhmikosR XhmikosR changed the title Fix tooltip when hovering a child (delegateTarget) Fix tooltip when hovering a child element (delegateTarget) Jun 21, 2020
olsza pushed a commit to olsza/bootstrap that referenced this pull request Oct 3, 2020
@tkrotoff tkrotoff deleted the tooltip-delegateTarget branch October 20, 2020 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tooltips Do Not Work on Child Elements
5 participants