mirror of
https://github.com/wassname/talk.git
synced 2026-07-04 03:20:08 +08:00
ClickOutside should only toggle action when open
This commit is contained in:
@@ -19,7 +19,9 @@ export default class Toggleable extends React.Component {
|
||||
}
|
||||
|
||||
close = () => {
|
||||
this.setState({isOpen: false});
|
||||
if (this.state.isOpen) {
|
||||
this.setState({isOpen: false});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -133,7 +133,9 @@ export default class FlagButton extends Component {
|
||||
}
|
||||
|
||||
handleClickOutside = () => {
|
||||
this.closeMenu();
|
||||
if (this.state.showMenu) {
|
||||
this.closeMenu();
|
||||
}
|
||||
}
|
||||
|
||||
render () {
|
||||
|
||||
Reference in New Issue
Block a user