Skip to content

Commit d4bd605

Browse files
authored
fix: dropdown search blur (#1425)
1 parent 927208f commit d4bd605

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unfold/templates/unfold/helpers/search.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
x-on:focus="openSearchResults = true; currentIndex = 0"
1313
x-on:keydown.arrow-down.prevent="nextItem()"
1414
x-on:keydown.arrow-up.prevent="prevItem()"
15-
x-on:keydown.escape.prevent="openSearchResults=false"
15+
x-on:keydown.escape.prevent="openSearchResults = false; if ($refs.searchInput.value === '') { $refs.searchInput.blur() } else { $refs.searchInput.value = '' }"
1616
x-on:keydown.enter.prevent="selectItem()"
1717
x-on:search="currentIndex = 0"
1818
hx-get="{% url "admin:search" %}"

0 commit comments

Comments
 (0)