From 9bdb3a334f34b2ba2a82c024ed3d63522038fdb8 Mon Sep 17 00:00:00 2001 From: MareStare Date: Tue, 18 Mar 2025 23:03:52 +0000 Subject: [PATCH] Hide the popup entirely if there are no items to show --- assets/js/utils/suggestions-view.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/assets/js/utils/suggestions-view.ts b/assets/js/utils/suggestions-view.ts index 361af00e..2454c706 100644 --- a/assets/js/utils/suggestions-view.ts +++ b/assets/js/utils/suggestions-view.ts @@ -321,6 +321,13 @@ export class SuggestionsPopupComponent { } showForElement(targetElement: HTMLElement) { + if (this.items.length === 0) { + // Hide the popup because there are no suggestions to show. We have to do it + // explicitly, because a border is still rendered even for an empty popup. + this.hide(); + return; + } + this.container.style.position = 'absolute'; this.container.style.left = `${targetElement.offsetLeft}px`;