]> cat aescling's git repositories - mastodon.git/commitdiff
Handle global hotkeys even when no element has focus (#8998)
authorThibG <thib@sitedethib.com>
Wed, 17 Oct 2018 14:56:16 +0000 (16:56 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 17 Oct 2018 14:56:16 +0000 (16:56 +0200)
This fixes hotkeys not working when pressing the column
“back” button, for instance.

app/javascript/mastodon/features/ui/index.js

index fb6f675f4cffcd97e52b65bc86df755b68511206..662375a769db12eeeb95d35890e70c410cf49f76 100644 (file)
@@ -460,7 +460,7 @@ class UI extends React.PureComponent {
     };
 
     return (
-      <HotKeys keyMap={keyMap} handlers={handlers} ref={this.setHotkeysRef}>
+      <HotKeys keyMap={keyMap} handlers={handlers} ref={this.setHotkeysRef} attach={window} focused>
         <div className={classNames('ui', { 'is-composing': isComposing })} ref={this.setRef} style={{ pointerEvents: dropdownMenuIsOpen ? 'none' : null }}>
           <TabsBar />