Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
fix: set 0 width/height in createHiddenSvgNode
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Williams committed Nov 20, 2019
1 parent 1c7f019 commit 9059f4b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/superset-ui-dimension/src/svg/createHiddenSvgNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ import { SVG_NS } from './constants';
export default function createHiddenSvgNode() {
const svgNode = document.createElementNS(SVG_NS, 'svg');
svgNode.style.position = 'absolute'; // so it won't disrupt page layout
svgNode.style.opacity = '0'; // and not visible
svgNode.style.pointerEvents = 'none'; // and not capturing mouse events
svgNode.style.top = '-100%';
svgNode.style.left = '-100%';
svgNode.style.width = '0'; // no dimensions
svgNode.style.height = '0';
svgNode.style.opacity = '0'; // not visible
svgNode.style.pointerEvents = 'none'; // won't capture mouse events

return svgNode;
}

0 comments on commit 9059f4b

Please sign in to comment.