From bfb5706b4a3e7f883ce9ee0d829ad145f3d13d88 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 28 Nov 2019 20:51:21 +0000 Subject: [PATCH] don't consume all keys Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/ContextualMenu.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/structures/ContextualMenu.js b/src/components/structures/ContextualMenu.js index 756ebec863..4927d219b2 100644 --- a/src/components/structures/ContextualMenu.js +++ b/src/components/structures/ContextualMenu.js @@ -183,6 +183,8 @@ export class ContextMenu extends React.Component { }; _onKeyDown = (ev) => { + let handled = true; + switch (ev.key) { case Key.TAB: case Key.ESCAPE: @@ -200,11 +202,15 @@ export class ContextMenu extends React.Component { case Key.END: this._onMoveFocusHomeEnd(this.state.contextMenuElem, false); break; + default: + handled = false; } - // consume all other keys in context menu - ev.stopPropagation(); - ev.preventDefault(); + if (handled) { + // consume all other keys in context menu + ev.stopPropagation(); + ev.preventDefault(); + } }; renderMenu(hasBackground=this.props.hasBackground) {