From 926f0404263dfb5b360f34d79f47661c23481509 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 17 Jan 2021 13:41:08 +0100 Subject: [PATCH] Fix hiding suggestion dropdown when no suggestion are available See 0a9081c855bf8b9ab0ffbd5ab98679a11f23849c --- ts/WoltLabSuite/Core/Ui/Suggestion.ts | 2 +- wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Suggestion.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ts/WoltLabSuite/Core/Ui/Suggestion.ts b/ts/WoltLabSuite/Core/Ui/Suggestion.ts index 177572f90f..ce49342397 100644 --- a/ts/WoltLabSuite/Core/Ui/Suggestion.ts +++ b/ts/WoltLabSuite/Core/Ui/Suggestion.ts @@ -218,7 +218,7 @@ class UiSuggestion implements AjaxCallbackObject { this.dropdownMenu.innerHTML = ""; } - if (Array.isArray(data.returnValues)) { + if (Array.isArray(data.returnValues) && data.returnValues.length > 0) { data.returnValues.forEach((item, index) => { const anchor = document.createElement("a"); if (item.icon) { diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Suggestion.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Suggestion.js index 052f5f8bf3..d71465882f 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Suggestion.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Suggestion.js @@ -169,7 +169,7 @@ define(["require", "exports", "tslib", "../Ajax", "../Core", "./Dropdown/Simple" else { this.dropdownMenu.innerHTML = ""; } - if (Array.isArray(data.returnValues)) { + if (Array.isArray(data.returnValues) && data.returnValues.length > 0) { data.returnValues.forEach((item, index) => { const anchor = document.createElement("a"); if (item.icon) { -- 2.20.1