From 2572d9653b7d31735275d3f71cf4382ae92805e1 Mon Sep 17 00:00:00 2001 From: Raymond Cao <87154366+raymondcao-everlaw@users.noreply.github.com> Date: Thu, 11 Nov 2021 00:46:05 -0800 Subject: [PATCH] Fix #2406 - tooltip positioning issue with SVG target (#2407) --- src/components/utils/DomHandler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/utils/DomHandler.js b/src/components/utils/DomHandler.js index 1e3611bba9..6c5381939a 100644 --- a/src/components/utils/DomHandler.js +++ b/src/components/utils/DomHandler.js @@ -34,7 +34,7 @@ export default class DomHandler { static getOuterWidth(el, margin) { if (el) { - let width = el.offsetWidth; + let width = el.offsetWidth ?? el.getBoundingClientRect().width; if (margin) { let style = getComputedStyle(el); @@ -48,7 +48,7 @@ export default class DomHandler { static getOuterHeight(el, margin) { if (el) { - let height = el.offsetHeight; + let height = el.offsetHeight ?? el.getBoundingClientRect().height; if (margin) { let style = getComputedStyle(el);