From ed34cd7e3f404195a3f0f18aed9feb99f3a61214 Mon Sep 17 00:00:00 2001 From: NejcZdovc Date: Wed, 8 Feb 2017 18:37:07 +0100 Subject: [PATCH] Added tab press to select autocomplete Resovles #7132 Auditors: @srirambv @bsclifton Test Plan: - Ensure you have auto complete suggestion for on an input filed - Press down on the input field to highlight the suggestion - Once highlighted press tab, field should be filled --- js/components/contextMenu.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/components/contextMenu.js b/js/components/contextMenu.js index 82cb02a14e3..0c357422e98 100644 --- a/js/components/contextMenu.js +++ b/js/components/contextMenu.js @@ -276,7 +276,11 @@ class ContextMenu extends ImmutableComponent { switch (e.keyCode) { case keyCodes.ENTER: - e.preventDefault() + case KeyCodes.TAB: + if (e.keyCode === keyCodes.ENTER) { + e.preventDefault() + } + e.stopPropagation() if (currentIndex !== null) { const action = selectedTemplate.getIn([currentIndex, 'click']) @@ -288,7 +292,6 @@ class ContextMenu extends ImmutableComponent { break case KeyCodes.ESC: - case KeyCodes.TAB: windowActions.resetMenuState() break