Skip to content

Commit 979086c

Browse files
fix: make search box relative to <base> tag (#280)
1 parent b3c39de commit 979086c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

static/search/search-box.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,12 @@ class SearchBox {
320320
* @param {SearchResult} result
321321
*/
322322
confirmResult(result) {
323-
window.location.assign(result.item.address);
323+
const base = document.querySelector('base');
324+
if (base) {
325+
window.location.assign(base.href + result.item.address);
326+
} else {
327+
window.location.assign(result.item.address);
328+
}
324329
}
325330

326331
/**

0 commit comments

Comments
 (0)