ClickOutside should only toggle action when open

This commit is contained in:
Chi Vinh Le
2017-08-15 21:32:44 +07:00
parent 4cfdb6574b
commit 2b2e2f9b5f
3 changed files with 11 additions and 5 deletions
@@ -28,9 +28,11 @@ export default class PermalinkButton extends React.Component {
}
handleClickOutside = () => {
this.setState({
popoverOpen: false
});
if (this.state.popoverOpen) {
this.setState({
popoverOpen: false
});
}
}
copyPermalink = () => {