Skip to content

Build your personal knowledge base with Trilium Notes

feat(quick_search): align popup to bottom-center (closes #1679)

Elian Doran60217d4e4fe6
diff --git a/docs/Release Notes/Release Notes/v0.92.8-beta.md b/docs/Release Notes/Release Notes/v0.92.8-beta.md
index 4676b0d204..5cf968d241 100644
--- a/docs/Release Notes/Release Notes/v0.92.8-beta.md
+++ b/docs/Release Notes/Release Notes/v0.92.8-beta.md
@@ -25,6 +25,7 @@
* The following dialogs are now accessible: bulk actions, branch prefix, include note, add link, sort child notes, note type selector, move/clone to, import/export, markdown import, note revisions, info dialog.
* Delete notes now requests confirmation.
* Modals now have a safe margin on their bottom and are scrollable.
+* [Center Search results under quick search bar](https://github.com/TriliumNext/Notes/issues/1679)
## 🌍 Internationalization
diff --git a/src/public/app/widgets/quick_search.ts b/src/public/app/widgets/quick_search.ts
index 3b4b7e186a..2d06baafee 100644
--- a/src/public/app/widgets/quick_search.ts
+++ b/src/public/app/widgets/quick_search.ts
@@ -35,7 +35,7 @@ const TPL = /*html*/`
<button class="btn btn-outline-secondary search-button" type="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="bx bx-search"></span>
</button>
- <div class="dropdown-menu dropdown-menu-left tn-dropdown-list"></div>
+ <div class="dropdown-menu tn-dropdown-list"></div>
</div>
<input type="text" class="form-control form-control-sm search-string" placeholder="${t("quick-search.placeholder")}">
</div>`;
@@ -56,15 +56,17 @@ export default class QuickSearchWidget extends BasicWidget {
doRender() {
this.$widget = $(TPL);
+ this.$searchString = this.$widget.find(".search-string");
+ this.$dropdownMenu = this.$widget.find(".dropdown-menu");
+
this.dropdown = Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']")[0], {
+ reference: this.$searchString[0],
popperConfig: {
- strategy: "fixed"
+ strategy: "fixed",
+ placement: "bottom"
}
});
- this.$searchString = this.$widget.find(".search-string");
- this.$dropdownMenu = this.$widget.find(".dropdown-menu");
-
this.$widget.find(".input-group-prepend").on("shown.bs.dropdown", () => this.search());
if (utils.isMobile()) {