fix(modal): reposition tag autocomplete when suggestions load

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 <noreply@anthropic.com>
This commit is contained in:
2026-04-21 08:21:52 -04:00
parent 4539f0e2bf
commit 40010202b2
+8
View File
@@ -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) {