From 9d3db82745de9c17a1bd836fa1f08139fe73a45b Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 5 Dec 2024 10:13:32 +0100 Subject: [PATCH] IBX-4064: Search adjustements (#2566) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * custom.js: "See all results" → "See more results" * custom.js: No search result highlight on keyboard navigation (cherry picked from commit 33fc6d9e3535d6ea8b1fc4a9dd03f49e174e00ea) --- docs/js/custom.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/js/custom.js b/docs/js/custom.js index 28f4f03fd9..332f657d9a 100644 --- a/docs/js/custom.js +++ b/docs/js/custom.js @@ -123,7 +123,7 @@ $(document).ready(function() { let link = $('.ds-dropdown-menu a.search-page-link'); if (!link.length) { $('.ds-dropdown-menu').append(`
`); link = $('.ds-dropdown-menu a.search-page-link'); } @@ -144,6 +144,7 @@ $(document).ready(function() { debug: false, }); search.autocomplete.on('autocomplete:updated', event => { + $('.ds-cursor').removeClass('ds-cursor'); const searchedText = $('#search_input')[0].value.trim(); const separatorText = '›'; const separatorClass = 'aa-suggestion-title-separator'; @@ -170,8 +171,9 @@ $(document).ready(function() { }); $(document).on('keydown keypress', 'form.md-search__form', function(event) { - if (event.keyCode == 13) { + if (-1 != $.inArray(event.key, ['Enter', 'ArrowDown', 'ArrowUp'])) { event.preventDefault(); + $('.ds-cursor').removeClass('ds-cursor'); return false; }