From 78e72723440780814fced82cc8a2406c47992464 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@googlemail.com> Date: Sun, 7 May 2017 20:43:42 +0100 Subject: [PATCH] Fixes 2 issues with Dialog closing + Upload Confirmation dialog would just change focus on ESC and not close + Keywords Dialog in UserSettings would also close UserSettings because event bubbled up --- src/components/views/dialogs/BaseDialog.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/BaseDialog.js b/src/components/views/dialogs/BaseDialog.js index 279dedbd43..d567a0ba9a 100644 --- a/src/components/views/dialogs/BaseDialog.js +++ b/src/components/views/dialogs/BaseDialog.js @@ -57,6 +57,12 @@ export default React.createClass({ } }, + // Don't let key down events get any further, so they only trigger this and nothing more + _onKeyDown: function(e) { + e.stopPropagation(); + e.preventDefault(); + }, + // 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) { @@ -81,7 +87,7 @@ export default React.createClass({ const TintableSvg = sdk.getComponent("elements.TintableSvg"); return ( -
+