From a20a319a7a30a3caa733054e4f78bed1de957a74 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 5 May 2017 18:13:14 +0200 Subject: [PATCH] Fix focus issues in the CryptDrive search bar --- www/drive/main.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/www/drive/main.js b/www/drive/main.js index 3f2af6720..53a5586aa 100644 --- a/www/drive/main.js +++ b/www/drive/main.js @@ -369,6 +369,9 @@ define([ }); $(ifrw).keydown(function (e) { + var $searchBar = $tree.find('#searchInput'); + if ($searchBar.is(':focus') && $searchBar.val()) { return; } + var $elements = $content.find('.element:not(.header)'); var ev = {}; @@ -2025,6 +2028,14 @@ define([ placeholder: Messages.fm_searchPlaceholder }).keyup(function (e) { if (search.to) { window.clearTimeout(search.to); } + if ([38, 39, 40, 41].indexOf(e.which) !== -1) { + if (!$input.val()) { + $input.blur(); + return; + } else { + e.stopPropagation(); + } + } var isInSearchTmp = currentPath[0] === SEARCH; if ($input.val().trim() === "") { setSearchCursor(0);