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

This commit is contained in:
Elian Doran 2025-04-12 11:27:51 +03:00
parent 7fba2dfb8b
commit 60217d4e4f
No known key found for this signature in database
2 changed files with 10 additions and 7 deletions

View File

@ -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

View File

@ -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.dropdown = Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']")[0], {
popperConfig: {
strategy: "fixed"
}
});
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",
placement: "bottom"
}
});
this.$widget.find(".input-group-prepend").on("shown.bs.dropdown", () => this.search());
if (utils.isMobile()) {