fix: inconsistent state for select-all after deleting #700
Massimo Melina committed
Aug 15, 2024 at 18:03 UTC
3ce70c998dd2948c5e7c070fbee4bf3858b5082a
1 file changed
+4
frontend/src/FilterBar.ts
+4
@@ -17,6 +17,10 @@ export function FilterBar() {
17
18
const sel = Object.keys(selected).length
19
const fil = filteredList?.length
20
+ useEffect(() => {
21
+ if (all && sel < (fil || list.length))
22
+ setAll(false)
23
+ }, [sel])
24
const tabIndex = showFilter ? undefined : -1
25
return h('div', { id: 'filter-bar', style: { display: showFilter ? undefined : 'none' } },
26
h(Checkbox, {