Fix broken close button

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
This commit is contained in:
Johannes Marbach 2026-03-24 15:17:22 +01:00
parent 8fb380d465
commit 4f0eba6355

View file

@ -65,12 +65,7 @@ search backend.
// Dispose any existing popover. // Dispose any existing popover.
// //
{ disposePopover($targetSearchInput);
let popover = bootstrap.Popover.getInstance($targetSearchInput[0]);
if (popover !== null) {
popover.dispose();
}
}
// //
// Check if we need to do a search at all. // Check if we need to do a search at all.
@ -106,7 +101,7 @@ search backend.
.attr("aria-label", "Close") .attr("aria-label", "Close")
.on("click", () => { .on("click", () => {
$targetSearchInput.val(""); $targetSearchInput.val("");
$targetSearchInput.trigger("change"); disposePopover($targetSearchInput);
}) })
) )
); );
@ -178,6 +173,13 @@ search backend.
// Helpers // Helpers
// //
const disposePopover = ($targetSearchInput) => {
const popover = bootstrap.Popover.getInstance($targetSearchInput[0]);
if (popover !== null) {
popover.dispose();
}
}
const renderResult = (data, index, $container) => { const renderResult = (data, index, $container) => {
// Add the main result's page title. // Add the main result's page title.
$container.append($("<div>") $container.append($("<div>")