Skip to content

Commit

Permalink
Fix opening of help menu on ESC press
Browse files Browse the repository at this point in the history
  • Loading branch information
akshitkrnagpal authored and saghul committed Jul 4, 2018
1 parent 5ba65fb commit d47c142
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/features/navbar/components/HelpButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default class HelpButton extends Component< *, State> {

this._onAboutClick = openExternalLink.bind(undefined, config.aboutURL);
this._onIconClick = this._onIconClick.bind(this);
this._onOpenChange = this._onOpenChange.bind(this);
this._onPrivacyClick
= openExternalLink.bind(undefined, config.privacyPolicyURL);
this._onTermsClick
Expand All @@ -57,6 +58,19 @@ export default class HelpButton extends Component< *, State> {
});
}

_onOpenChange: (*) => void;

/**
* Closes droplist when clicked outside.
*
* @returns {void}
*/
_onOpenChange() {
this.setState({
droplistOpen: false
});
}

_onPrivacyClick: (*) => void;

_onTermsClick: (*) => void;
Expand All @@ -73,7 +87,7 @@ export default class HelpButton extends Component< *, State> {
<Droplist
isOpen = { this.state.droplistOpen }
onClick = { this._onIconClick }
onOpenChange = { this._onIconClick }
onOpenChange = { this._onOpenChange }
position = 'right bottom'
trigger = { <HelpIcon /> }>
<Group heading = 'Help'>
Expand Down

0 comments on commit d47c142

Please sign in to comment.