mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-03-23 20:27:14 +01:00
Hide the popup entirely if there are no items to show
This commit is contained in:
parent
a3ab0d2b41
commit
9bdb3a334f
1 changed files with 7 additions and 0 deletions
|
@ -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`;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue