From 8183b79614ac2c5bb68445c02aeab7bdb819f336 Mon Sep 17 00:00:00 2001 From: Jen Downs Date: Wed, 1 Jul 2020 22:53:40 -0500 Subject: [PATCH] fix(data-decorator): allow inner panel to be closed with esc key or click outside (#646) --- src/components/DataDecorator/DataDecorator.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/DataDecorator/DataDecorator.js b/src/components/DataDecorator/DataDecorator.js index 6d0901034..edf4de69f 100644 --- a/src/components/DataDecorator/DataDecorator.js +++ b/src/components/DataDecorator/DataDecorator.js @@ -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() { @@ -90,6 +90,7 @@ class DataDecorator extends Component { />