Skip to content

Commit

Permalink
Fix: Keep cursor in search box after applying filter
Browse files Browse the repository at this point in the history
  • Loading branch information
vennelaeruvala committed Nov 15, 2024
1 parent 02784e5 commit 7342ef6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions assets/html/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,9 @@ function runSearchMainCode() {
}

$(".search-modal-card-body").html(search_result_container);
// Refocus the search input field when there's no search query
$(".documenter-search-input").focus();

} else {
if (!$(".search-modal-card-body").hasClass("is-justify-content-center")) {
$(".search-modal-card-body").addClass("is-justify-content-center");
Expand All @@ -512,6 +515,8 @@ function runSearchMainCode() {
$(".search-modal-card-body").html(`
<div class="has-text-centered my-5 py-5">Type something to get started!</div>
`);
// Refocus the search input field when there's no search query
$(".documenter-search-input").focus();
}
}

Expand Down

0 comments on commit 7342ef6

Please sign in to comment.