diff --git a/src/commands/index.jsx b/src/commands/index.jsx index b0cb4d00..f1080361 100644 --- a/src/commands/index.jsx +++ b/src/commands/index.jsx @@ -113,8 +113,13 @@ class Commands extends Component { handleClickOutside = () => { const { commands } = this.props; + const { open } = this.state; - this.setState({ + if (!open) { + return false; + } + + return this.setState({ open: false, commands }); diff --git a/src/icon-menu/index.jsx b/src/icon-menu/index.jsx index f2a0b76a..aaab0b58 100644 --- a/src/icon-menu/index.jsx +++ b/src/icon-menu/index.jsx @@ -83,13 +83,18 @@ class IconMenu extends Component { closeMenu() { const { onMenuClose } = this.props; + const { open } = this.state; + + if (!open) { + return false; + } this.setState({ open: false, positioned: false }); - onMenuClose(); + return onMenuClose(); } handleClickOutside = () => this.closeMenu() diff --git a/src/select/index.jsx b/src/select/index.jsx index 5dcc30d5..8ddbbae1 100644 --- a/src/select/index.jsx +++ b/src/select/index.jsx @@ -104,7 +104,13 @@ class Select extends Component { } closeSelect() { - this.setState({ + const { open } = this.state; + + if (!open) { + return false; + } + + return this.setState({ open: false, positioned: false });