Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-25 03:06:10 +01:00

Make a distinction between active and selected in the issue author dropdown (#30207)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit f8fbaaf26fa7798fde690f4400910069fbccd40e)
This commit is contained in:
Yarden Shoham 2024-03-31 14:27:39 +03:00 committed by Gergely Nagy
parent c5dc579017
commit 6c3dbc2eee
No known key found for this signature in database

View 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);
};