Add range selection (#707)

This commit is contained in:
schroda
2024-04-05 02:03:00 +02:00
committed by GitHub
parent 568aaebc3e
commit ecd9b7478b
8 changed files with 101 additions and 41 deletions

View File

@@ -181,15 +181,15 @@ export function CategorySelect(props: Props) {
isSingleSelectionMode,
)}
onChange={(checked) => {
handleSelection(category.id, false, 'categoriesToAdd');
handleSelection(category.id, false, 'categoriesToRemove');
handleSelection(category.id, false, { key: 'categoriesToAdd' });
handleSelection(category.id, false, { key: 'categoriesToRemove' });
if (checked) {
handleSelection(category.id, true, 'categoriesToAdd');
handleSelection(category.id, true, { key: 'categoriesToAdd' });
}
if (checked === false) {
handleSelection(category.id, true, 'categoriesToRemove');
handleSelection(category.id, true, { key: 'categoriesToRemove' });
}
}}
label={category.name}