]> source.dussan.org Git - gitea.git/commitdiff
Make a distinction between `active` and `selected` in the issue author dropdown ...
authorYarden Shoham <git@yardenshoham.com>
Sun, 31 Mar 2024 11:27:39 +0000 (14:27 +0300)
committerGitHub <noreply@github.com>
Sun, 31 Mar 2024 11:27:39 +0000 (11:27 +0000)
Signed-off-by: Yarden Shoham <git@yardenshoham.com>
web_src/js/features/repo-issue-list.js

index ccd13bbcf5e3f0c970a25ec5ca1548901692eed0..92f058c4d20e1842e729ad2bf90cddc7f86de451 100644 (file)
@@ -149,7 +149,9 @@ function initRepoIssueListAuthorDropdown() {
     $searchDropdown.dropdown('refresh');
     // defer our selection to the next tick, because dropdown will set the selection item after this `menu` function
     setTimeout(() => {
-      menu.querySelector('.item.active, .item.selected')?.classList.remove('active', 'selected');
+      for (const el of menu.querySelectorAll('.item.active, .item.selected')) {
+        el.classList.remove('active', 'selected');
+      }
       menu.querySelector(`.item[data-value="${selectedUserId}"]`)?.classList.add('selected');
     }, 0);
   };