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 positioning issue with SVG targets #2407

Merged

Conversation

raymondcao-everlaw
Copy link
Contributor

Defect Fixes

Addresses #2406.

The issue was that if the target of a global tooltip was an SVG, the tooltip would not be positioned next to the target when triggered (it will often appear offscreen). The source of the problem was that DomHandler.getOuterWidth and DomHandler.getOuterHeight rely on Element.offsetWidth to get the target element's width. This works for HTMLElement instances but not SVGElement instances.

My PR uses Element.getBoundingClientRect to get the target element's width when Element.offsetWidth is undefined.

@mertsincan mertsincan merged commit 2572d96 into primefaces:master Nov 11, 2021
@mertsincan
Copy link
Member

Thanks a lot for your contribution!

Best Regards,

@raymondcao-everlaw raymondcao-everlaw deleted the tooltip-svg-target-fix branch November 11, 2021 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants