Fix double-toggling issue in download client filter
All checks were successful
All checks were successful
This commit is contained in:
@@ -1151,6 +1151,11 @@ function updateDownloadClientFilter() {
|
||||
checkbox.checked = selectedDownloadClients.includes(client.id);
|
||||
checkbox.id = `client-${client.id}`;
|
||||
|
||||
// Toggle selection when checkbox changes
|
||||
checkbox.addEventListener('change', (e) => {
|
||||
toggleClientSelection(client.id, e.target.checked);
|
||||
});
|
||||
|
||||
const label = document.createElement('label');
|
||||
label.className = 'download-client-option-label';
|
||||
label.htmlFor = `client-${client.id}`;
|
||||
@@ -1164,19 +1169,6 @@ function updateDownloadClientFilter() {
|
||||
option.appendChild(label);
|
||||
option.appendChild(typeBadge);
|
||||
|
||||
// Toggle selection when clicking the row
|
||||
option.addEventListener('click', (e) => {
|
||||
if (e.target !== checkbox) {
|
||||
checkbox.checked = !checkbox.checked;
|
||||
}
|
||||
toggleClientSelection(client.id, checkbox.checked);
|
||||
});
|
||||
|
||||
// Toggle selection when checkbox changes
|
||||
checkbox.addEventListener('change', (e) => {
|
||||
toggleClientSelection(client.id, e.target.checked);
|
||||
});
|
||||
|
||||
optionsContainer.appendChild(option);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user