about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components/modal_root.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-05-11 22:42:32 +0200
committerThibaut Girka <thib@sitedethib.com>2018-05-11 22:42:32 +0200
commit769a48495c8eac64a80f10134be5362ddf8ca107 (patch)
tree4f0af3b1fb16299f62c8058c226034bebc1648ac /app/javascript/flavours/glitch/components/modal_root.js
parent34142ab29c33104793afe3199f102d84b83b9b57 (diff)
Fix root modal's keyup handling (Fixes #478)
Diffstat (limited to 'app/javascript/flavours/glitch/components/modal_root.js')
-rw-r--r--app/javascript/flavours/glitch/components/modal_root.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/components/modal_root.js b/app/javascript/flavours/glitch/components/modal_root.js
index 789e117c7..89f81f58e 100644
--- a/app/javascript/flavours/glitch/components/modal_root.js
+++ b/app/javascript/flavours/glitch/components/modal_root.js
@@ -6,6 +6,7 @@ export default class ModalRoot extends React.PureComponent {
   static propTypes = {
     children: PropTypes.node,
     onClose: PropTypes.func.isRequired,
+    noEsc: PropTypes.bool,
   };
 
   state = {
@@ -16,7 +17,7 @@ export default class ModalRoot extends React.PureComponent {
 
   handleKeyUp = (e) => {
     if ((e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27)
-         && !!this.props.children && !this.props.props.noEsc) {
+         && !!this.props.children && !this.props.noEsc) {
       this.props.onClose();
     }
   }