Hide the popup entirely if there are no items to show

This commit is contained in:
MareStare 2025-03-18 23:03:52 +00:00
parent a3ab0d2b41
commit 9bdb3a334f

View file

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