From 843e94574e46a70152eefdaa246cfa8c68e3fd8d Mon Sep 17 00:00:00 2001 From: Conglei Date: Wed, 12 Sep 2018 21:28:45 -0700 Subject: [PATCH] fixed modal close issue (#5865) * fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce53c8261cc96db89e0be9c536e4a771896) --- .../assets/src/components/ModalTrigger.jsx | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/superset/assets/src/components/ModalTrigger.jsx b/superset/assets/src/components/ModalTrigger.jsx index 83e8db361f3da..f8ab6510530ed 100644 --- a/superset/assets/src/components/ModalTrigger.jsx +++ b/superset/assets/src/components/ModalTrigger.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { Modal, MenuItem } from 'react-bootstrap'; import cx from 'classnames'; @@ -83,29 +83,35 @@ export default class ModalTrigger extends React.Component { }); if (this.props.isButton) { return ( - {this.renderModal()} - + ); } else if (this.props.isMenuItem) { return ( - - {this.props.triggerNode} + + + {this.props.triggerNode} + {this.renderModal()} - + ); } /* eslint-disable jsx-a11y/interactive-supports-focus */ return ( - - {this.props.triggerNode} + + + {this.props.triggerNode} + {this.renderModal()} - + ); } }