We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee4cc54 commit 48e5c48Copy full SHA for 48e5c48
components/menu/Menu.jsx
@@ -106,7 +106,9 @@ class Menu extends React.Component {
106
};
107
108
calculatePosition () {
109
- const {top, left, height, width} = ReactDOM.findDOMNode(this).parentNode.getBoundingClientRect();
+ const parentNode = ReactDOM.findDOMNode(this).parentNode;
110
+ if (!parentNode) return;
111
+ const {top, left, height, width} = parentNode.getBoundingClientRect();
112
const {height: wh, width: ww} = utils.getViewport();
113
const toTop = top < ((wh / 2) - height / 2);
114
const toLeft = left < ((ww / 2) - width / 2);
0 commit comments