From 52ba5c5bb746185a969af8c2314bf33dc2057647 Mon Sep 17 00:00:00 2001 From: Siddhant Sehgal <35633575+coderrsid@users.noreply.github.com> Date: Mon, 30 Mar 2020 23:03:36 +0530 Subject: [PATCH] Desktop: Close `Goto Anything` modal on outside click (#2940) * Close goto modal on outside click * Renamed for consistency Co-authored-by: Laurent Cozic --- ElectronClient/plugins/GotoAnything.jsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ElectronClient/plugins/GotoAnything.jsx b/ElectronClient/plugins/GotoAnything.jsx index 8c73f04248..b0995f5cc2 100644 --- a/ElectronClient/plugins/GotoAnything.jsx +++ b/ElectronClient/plugins/GotoAnything.jsx @@ -48,6 +48,7 @@ class Dialog extends React.PureComponent { this.onKeyDown = this.onKeyDown.bind(this); this.input_onChange = this.input_onChange.bind(this); this.input_onKeyDown = this.input_onKeyDown.bind(this); + this.modalLayer_onClick = this.dialogModalLayer_onClick.bind(this); this.listItemRenderer = this.listItemRenderer.bind(this); this.listItem_onClick = this.listItem_onClick.bind(this); this.helpButton_onClick = this.helpButton_onClick.bind(this); @@ -114,6 +115,14 @@ class Dialog extends React.PureComponent { } } + modalLayer_onClick() { + this.props.dispatch({ + pluginName: PLUGIN_NAME, + type: 'PLUGIN_DIALOG_SET', + open: false, + }); + } + helpButton_onClick() { this.setState({ showHelp: !this.state.showHelp }); } @@ -385,7 +394,7 @@ class Dialog extends React.PureComponent { const helpComp = !this.state.showHelp ? null :
{_('Type a note title to jump to it. Or type # followed by a tag name, or @ followed by a notebook name, or / followed by note content.')}
; return ( -
+
{helpComp}