From 38bfbfb8f3a8f8c3bd0df4c3498c980ec3442d7e Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 22 May 2015 22:44:25 +0200 Subject: [PATCH] Added Tab and Shift+Tab support to autocomplete --- public_html/js/Controls/AutoCompleteInput.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public_html/js/Controls/AutoCompleteInput.js b/public_html/js/Controls/AutoCompleteInput.js index a4c751c9..0c268bd6 100644 --- a/public_html/js/Controls/AutoCompleteInput.js +++ b/public_html/js/Controls/AutoCompleteInput.js @@ -6,6 +6,7 @@ App.Controls.AutoCompleteInput = function($input) { var jQuery = App.DI.get('jQuery'); var tagList = App.DI.get('tagList'); + var KEY_TAB = 9; var KEY_RETURN = 13; var KEY_DELETE = 46; var KEY_ESCAPE = 27; @@ -68,6 +69,12 @@ App.Controls.AutoCompleteInput = function($input) { var func = null; if (isShown() && e.which === KEY_ESCAPE) { func = hide; + } else if (isShown() && e.which === KEY_TAB) { + if (e.shiftKey) { + func = selectPrevious; + } else { + func = selectNext; + } } else if (isShown() && e.which === KEY_DOWN) { func = selectNext; } else if (isShown() && e.which === KEY_UP) {