From 8e98b79647089fe4bb7b1ec408f0c4b51a0ca464 Mon Sep 17 00:00:00 2001 From: Conglei Shi Date: Tue, 11 Sep 2018 20:30:21 -0700 Subject: [PATCH 1/2] fixed modal close issue --- .../assets/src/components/ModalTrigger.jsx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/superset/assets/src/components/ModalTrigger.jsx b/superset/assets/src/components/ModalTrigger.jsx index 83e8db361f3da..1628238d7ca88 100644 --- a/superset/assets/src/components/ModalTrigger.jsx +++ b/superset/assets/src/components/ModalTrigger.jsx @@ -82,31 +82,31 @@ export default class ModalTrigger extends React.Component { 'btn btn-default btn-sm': this.props.isButton, }); if (this.props.isButton) { - return ( + return [ - ); + , + this.renderModal(), + ]; } else if (this.props.isMenuItem) { - return ( + return [ {this.props.triggerNode} - {this.renderModal()} - - ); + , + this.renderModal(), + ]; } /* eslint-disable jsx-a11y/interactive-supports-focus */ - return ( + return [ {this.props.triggerNode} - {this.renderModal()} - - ); + , + this.renderModal(), + ]; } } From 2dd4c691b1f3139952742d4471403218c596c359 Mon Sep 17 00:00:00 2001 From: Conglei Shi Date: Wed, 12 Sep 2018 12:09:32 -0700 Subject: [PATCH 2/2] change Children array to Fragment --- .../assets/src/components/ModalTrigger.jsx | 52 +++++++++++-------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/superset/assets/src/components/ModalTrigger.jsx b/superset/assets/src/components/ModalTrigger.jsx index 1628238d7ca88..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'; @@ -82,31 +82,37 @@ export default class ModalTrigger extends React.Component { 'btn btn-default btn-sm': this.props.isButton, }); if (this.props.isButton) { - return [ - , - this.renderModal(), - ]; + return ( + + + {this.renderModal()} + + ); } else if (this.props.isMenuItem) { - return [ - - {this.props.triggerNode} - , - this.renderModal(), - ]; + return ( + + + {this.props.triggerNode} + + {this.renderModal()} + + ); } /* eslint-disable jsx-a11y/interactive-supports-focus */ - return [ - - {this.props.triggerNode} - , - this.renderModal(), - ]; + return ( + + + {this.props.triggerNode} + + {this.renderModal()} + + ); } }