From b7fdcacf77687dc742c63f201e7b2f6feb73b108 Mon Sep 17 00:00:00 2001 From: Djeex Date: Thu, 4 Sep 2025 12:11:58 +0200 Subject: [PATCH] Fixed wrong focus and suggestion drop down delay --- src/webui/js/gallery-editor.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/webui/js/gallery-editor.js b/src/webui/js/gallery-editor.js index db592d8..83b4bea 100644 --- a/src/webui/js/gallery-editor.js +++ b/src/webui/js/gallery-editor.js @@ -251,11 +251,9 @@ function renderTags(imgIndex, tags) { }); input.addEventListener('blur', () => { - setTimeout(() => { - suggestionBox.style.display = 'none'; - input.value = ''; - validateBtn.style.display = 'none'; - }, 150); + suggestionBox.style.display = 'none'; + input.value = ''; + validateBtn.style.display = 'none'; }); // --- Validate button action --- @@ -267,9 +265,10 @@ function renderTags(imgIndex, tags) { validateBtn.style.display = 'none'; } }; - - input.focus(); updateSuggestions(); + if (!input.value.trim()) { + suggestionBox.style.display = 'none'; + } } // --- Update tags in galleryImages array ---