Skip to content

Commit 777518d

Browse files
committed
fixes #28696 Return to the default content when .search-input is empty -Add a validation when input search is empty on top of 'startSearch()'
1 parent 7f9c4aa commit 777518d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/librustdoc/html/static/main.js

+9
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,15 @@
715715
}
716716

717717
function startSearch() {
718+
719+
$(".search-input").on("keyup",function() {
720+
if ($(this).val().length === 0) {
721+
window.history.replaceState("", "std - Rust", "?search=");
722+
$('#main.content').removeClass('hidden');
723+
$('#search.content').addClass('hidden');
724+
}
725+
});
726+
718727
var keyUpTimeout;
719728
$('.do-search').on('click', search);
720729
$('.search-input').on('keyup', function() {

0 commit comments

Comments
 (0)