Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce debounce to make search about 2x faster #2407

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions assets/html/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ let filters = [...new Set(data.map((x) => x.category))];
var modal_filters = make_modal_body_filters(filters);
var filter_results = [];

$(document).on("keyup", ".documenter-search-input", function (event) {
$(document).on("input", ".documenter-search-input", function (event) {
// Adding a debounce to prevent disruptions from super-speed typing!
debounce(() => update_search(filter_results), 300);
debounce(() => update_search(filter_results), 100);
});

$(document).on("click", ".search-filter", function () {
Expand All @@ -176,7 +176,7 @@ $(document).on("click", ".search-filter", function () {
}

// Adding a debounce to prevent disruptions from crazy clicking!
debounce(() => get_filters(), 300);
debounce(() => get_filters(), 100);
});

/**
Expand Down
Loading