Skip to content

Commit c6aca2c

Browse files
authored
fix: prevent double event propagation in command (#1543)
1 parent bd7a172 commit c6aca2c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/unfold/static/unfold/css/styles.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/unfold/static/unfold/js/app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ function searchCommand() {
127127
}
128128
},
129129
handleContentLoaded(event) {
130+
if (event.target.id !== "command-results") {
131+
return;
132+
}
133+
130134
this.items = event.target.querySelectorAll("li");
131135
this.currentIndex = 0;
132136
this.hasResults = this.items.length > 0;

src/unfold/templates/unfold/helpers/command_results.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<li class="group"
77
x-bind:class="{'active': currentIndex === {{ forloop.counter }}}"
88
x-on:mouseenter="currentIndex = {{ forloop.counter }}">
9-
<a class="bg-base-100 flex items-center rounded-default px-3.5 py-3 transition-colors group-[.active]:bg-primary-600 group-[.active]:text-white dark:bg-white/[.04] dark:text-base-200 dark:group-[.active]:bg-primary-600 dark:group-[.active]:text-white"
9+
<a class="bg-base-100 flex items-center rounded-default px-3.5 py-3 group-[.active]:bg-primary-600 group-[.active]:text-white dark:bg-white/[.04] dark:text-base-200 dark:group-[.active]:bg-primary-600 dark:group-[.active]:text-white"
1010
href="{{ item.link }}"
1111
data-title="{{ item.title }}"
1212
data-description="{{ item.description }}"
@@ -25,7 +25,7 @@
2525
<span class="text-font-subtle-light dark:text-font-subtle-dark group-[.active]:text-white">{{ item.description|capfirst }}</span>
2626
</span>
2727

28-
<span class="material-symbols-outlined ml-auto text-sm transition-all group-[.active]:text-white group-[.active]:-mr-1">arrow_forward</span>
28+
<span class="material-symbols-outlined ml-auto text-sm transition-transform group-[.active]:text-white group-[.active]:-translate-x-[2px]">arrow_forward</span>
2929
</a>
3030
</li>
3131
{% endfor %}

0 commit comments

Comments
 (0)