Skip to content

Commit

Permalink
fix: apply fixed positioning to hidden tooltip (#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 authored Jun 16, 2020
1 parent c540c8a commit 12b1135
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .storybook/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ html {
background: #1a1b20;
}

.echInvisible {
visibility: hidden;
}

#story-root {
padding: 20px;
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion integration/page_objects/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
}
Expand Down
4 changes: 0 additions & 4 deletions src/components/_global.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.invisible {
visibility: hidden;
}

.echChartStatus {
visibility: hidden;
pointer-events: none;
Expand Down
5 changes: 5 additions & 0 deletions src/components/portal/_portal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@
position: absolute;
pointer-events: none;
}

.echTooltipPortal__invisible {
position: fixed;
visibility: hidden;
}
7 changes: 6 additions & 1 deletion src/components/portal/tooltip_portal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,12 @@ const TooltipPortalComponent = ({ anchor, scope, settings, children, visible, ch
}
}, [updateAnchorDimensions, popper]);

return createPortal(<div className={classNames({ invisible })}>{children}</div>, portalNode.current);
return createPortal(
<div className={classNames({ echTooltipPortal__invisible: invisible })}>
{children}
</div>,
portalNode.current,
);
};

TooltipPortalComponent.displayName = 'TooltipPortal';
Expand Down

0 comments on commit 12b1135

Please sign in to comment.