Skip to content

Commit

Permalink
custom.js: No search result highlight on keyboard nav
Browse files Browse the repository at this point in the history
  • Loading branch information
adriendupuis committed Dec 4, 2024
1 parent 83139d9 commit 9ec43a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
}
Expand Down

0 comments on commit 9ec43a8

Please sign in to comment.