Skip to content

Commit

Permalink
Make a distinction between active and selected in the issue autho…
Browse files Browse the repository at this point in the history
…r dropdown (#30207)

Signed-off-by: Yarden Shoham <[email protected]>
  • Loading branch information
yardenshoham authored Mar 31, 2024
1 parent 44dd6d6 commit f8fbaaf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web_src/js/features/repo-issue-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down

0 comments on commit f8fbaaf

Please sign in to comment.