From f8fbaaf26fa7798fde690f4400910069fbccd40e Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Sun, 31 Mar 2024 14:27:39 +0300 Subject: [PATCH] Make a distinction between `active` and `selected` in the issue author dropdown (#30207) Signed-off-by: Yarden Shoham --- web_src/js/features/repo-issue-list.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web_src/js/features/repo-issue-list.js b/web_src/js/features/repo-issue-list.js index ccd13bbcf5..92f058c4d2 100644 --- a/web_src/js/features/repo-issue-list.js +++ b/web_src/js/features/repo-issue-list.js @@ -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); };