Prevent suggestions from closing when selecting an item from the list

This commit is contained in:
HighImKevin
2026-03-24 06:25:50 -04:00
parent e0ef614891
commit 135d69e598
+4 -1
View File
@@ -671,7 +671,10 @@
// Hide suggestions when focus leaves the input
input.addEventListener('blur', () => {
suggestionsDiv.style.display = 'none';
// If the user isn't targeting the suggestions div, hide them
if (!document.activeElement.closest(suggestionsDiv)) {
suggestionsDiv.style.display = 'none';
}
});
// Setup chevron button (triggers dropdown like down arrow)