From f7980b237a25a8975b59219924e7221b7663f4b2 Mon Sep 17 00:00:00 2001 From: Marco Vettorello Date: Tue, 16 Jun 2020 23:29:24 +0200 Subject: [PATCH 1/3] fix: apply positioning to hidden tooltip --- integration/page_objects/common.ts | 2 +- src/components/_global.scss | 3 ++- src/components/portal/tooltip_portal.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/integration/page_objects/common.ts b/integration/page_objects/common.ts index 6d07757902..f2e9483ada 100644 --- a/integration/page_objects/common.ts +++ b/integration/page_objects/common.ts @@ -157,7 +157,7 @@ class CommonPage { async toggleElementVisibility(selector: string) { await page.$$eval(selector, (elements) => { elements.forEach((element) => { - element.classList.toggle('invisible'); + element.classList.toggle('echInvisible'); }); }); } diff --git a/src/components/_global.scss b/src/components/_global.scss index 59d48a5a83..5704a36334 100644 --- a/src/components/_global.scss +++ b/src/components/_global.scss @@ -1,4 +1,5 @@ -.invisible { +.echInvisible { + position: fixed; visibility: hidden; } diff --git a/src/components/portal/tooltip_portal.tsx b/src/components/portal/tooltip_portal.tsx index 8b9a1b16a5..85d3010007 100644 --- a/src/components/portal/tooltip_portal.tsx +++ b/src/components/portal/tooltip_portal.tsx @@ -199,7 +199,7 @@ const TooltipPortalComponent = ({ anchor, scope, settings, children, visible, ch } }, [updateAnchorDimensions, popper]); - return createPortal(
{children}
, portalNode.current); + return createPortal(
{children}
, portalNode.current); }; TooltipPortalComponent.displayName = 'TooltipPortal'; From d0585b02a05edb6cdbbf90ac405747b8b642d3b9 Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Tue, 16 Jun 2020 17:38:24 -0500 Subject: [PATCH 2/3] chore: update and simplify class naming and usage --- .storybook/style.scss | 4 ++++ src/components/_global.scss | 5 ----- src/components/portal/_portal.scss | 5 +++++ src/components/portal/tooltip_portal.tsx | 7 ++++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.storybook/style.scss b/.storybook/style.scss index e608bd9318..bc26e8928f 100644 --- a/.storybook/style.scss +++ b/.storybook/style.scss @@ -14,6 +14,10 @@ html { background: #1a1b20; } +.echInvisible { + visibility: hidden; +} + #story-root { padding: 20px; width: 100%; diff --git a/src/components/_global.scss b/src/components/_global.scss index 5704a36334..2b68010552 100644 --- a/src/components/_global.scss +++ b/src/components/_global.scss @@ -1,8 +1,3 @@ -.echInvisible { - position: fixed; - visibility: hidden; -} - .echChartStatus { visibility: hidden; pointer-events: none; diff --git a/src/components/portal/_portal.scss b/src/components/portal/_portal.scss index b175c91007..9e22735aea 100644 --- a/src/components/portal/_portal.scss +++ b/src/components/portal/_portal.scss @@ -7,3 +7,8 @@ position: absolute; pointer-events: none; } + +.echPortalInvisible { + position: fixed; + visibility: hidden; +} diff --git a/src/components/portal/tooltip_portal.tsx b/src/components/portal/tooltip_portal.tsx index 85d3010007..cd8a0b4f10 100644 --- a/src/components/portal/tooltip_portal.tsx +++ b/src/components/portal/tooltip_portal.tsx @@ -199,7 +199,12 @@ const TooltipPortalComponent = ({ anchor, scope, settings, children, visible, ch } }, [updateAnchorDimensions, popper]); - return createPortal(
{children}
, portalNode.current); + return createPortal( +
+ {children} +
, + portalNode.current, + ); }; TooltipPortalComponent.displayName = 'TooltipPortal'; From 096ebfcdd9528abf8074867bd5edd146f9900d58 Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Tue, 16 Jun 2020 17:58:58 -0500 Subject: [PATCH 3/3] chore: update naming --- src/components/portal/_portal.scss | 2 +- src/components/portal/tooltip_portal.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/portal/_portal.scss b/src/components/portal/_portal.scss index 9e22735aea..90e6ecdc71 100644 --- a/src/components/portal/_portal.scss +++ b/src/components/portal/_portal.scss @@ -8,7 +8,7 @@ pointer-events: none; } -.echPortalInvisible { +.echTooltipPortal__invisible { position: fixed; visibility: hidden; } diff --git a/src/components/portal/tooltip_portal.tsx b/src/components/portal/tooltip_portal.tsx index cd8a0b4f10..1a7a19ff05 100644 --- a/src/components/portal/tooltip_portal.tsx +++ b/src/components/portal/tooltip_portal.tsx @@ -200,7 +200,7 @@ const TooltipPortalComponent = ({ anchor, scope, settings, children, visible, ch }, [updateAnchorDimensions, popper]); return createPortal( -
+
{children}
, portalNode.current,