From 40010202b2cc5b5969cb125d1705bb17f8aff42b Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 21 Apr 2026 08:21:52 -0400 Subject: [PATCH] fix(modal): reposition tag autocomplete when suggestions load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggestions arrive after the modal opens, so the autocomplete dropdown positioned itself downward before the suggestions section was visible and stayed there — covering the chips until the input lost and regained focus. Re-run positionAutocomplete() after renderSuggestions so it flips above the input. Co-Authored-By: Claude Opus 4.7 --- app/static/js/view-modal.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/static/js/view-modal.js b/app/static/js/view-modal.js index e859b1d..67dc5e5 100644 --- a/app/static/js/view-modal.js +++ b/app/static/js/view-modal.js @@ -178,6 +178,14 @@ document.addEventListener('DOMContentLoaded', () => { suggestionsList.appendChild(group); } suggestionsSection.style.display = total > 0 ? '' : 'none'; + + // Suggestions load async after the modal opens, so the autocomplete dropdown + // may have already positioned itself downward (before the section was visible). + // Re-run positioning so it flips above the input now that suggestions occupy + // the space below. + if (tagAutocomplete && tagAutocomplete.classList.contains('active')) { + positionAutocomplete(); + } } async function loadSuggestions(imageId) {