From 6bd7af29176d952f171591b1be147f4711802b69 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 16 May 2017 14:00:09 +0100 Subject: [PATCH] Revert "Merge pull request #867 from matrix-org/t3chguy/BaseDialog-patch1" This reverts commit 3549ff254325cdba689b425307218e678c89a2c8, reversing changes made to 1db677141ea281ac2fba361006597768110f77a5. --- src/components/views/dialogs/BaseDialog.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/components/views/dialogs/BaseDialog.js b/src/components/views/dialogs/BaseDialog.js index 02460148b3..279dedbd43 100644 --- a/src/components/views/dialogs/BaseDialog.js +++ b/src/components/views/dialogs/BaseDialog.js @@ -57,25 +57,20 @@ export default React.createClass({ } }, - // Don't let key{down,press} events escape the modal. Consume them all. - _eatKeyEvent: function(e) { - e.stopPropagation(); - }, - // Must be when the key is released (and not pressed) otherwise componentWillUnmount // will focus another element which will receive future key events _onKeyUp: function(e) { if (e.keyCode === KeyCode.ESCAPE) { + e.stopPropagation(); e.preventDefault(); this.props.onFinished(); } else if (e.keyCode === KeyCode.ENTER) { if (this.props.onEnterPressed) { + e.stopPropagation(); e.preventDefault(); this.props.onEnterPressed(e); } } - // Consume all keyup events while Modal is open - e.stopPropagation(); }, _onCancelClick: function(e) { @@ -86,11 +81,7 @@ export default React.createClass({ const TintableSvg = sdk.getComponent("elements.TintableSvg"); return ( -
+