Skip to content

Commit

Permalink
fix(data-decorator): allow inner panel to be closed with esc key or c…
Browse files Browse the repository at this point in the history
…lick outside (#646)
  • Loading branch information
jendowns authored Jul 2, 2020
1 parent 33200e4 commit 8183b79
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/DataDecorator/DataDecorator.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ class DataDecorator extends Component {
toggleOpen = () => (this.state.isOpen ? this.close() : this.open());

open = () => {
this.props.onOpen();
this.setState({ isOpen: true });
this.props.onOpen();
};

close = () => {
this.props.onClose();
this.setState({ isOpen: false });
this.props.onClose();
};

render() {
Expand Down Expand Up @@ -90,6 +90,7 @@ class DataDecorator extends Component {
/>
<PanelV2
isOpen={this.state.isOpen}
onClose={this.close}
stopPropagation={stopPropagation}
stopPropagationEvents={stopPropagationEvents}
closeButton={{
Expand Down

0 comments on commit 8183b79

Please sign in to comment.