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) {