Dmitriy Malayev
03/30/2023, 5:10 PMHello Everyone I have this checkbox working for select all. But the individual ones don't click. How do I fix it?
Box {
Checkbox {
onChange = { _, checked ->
checkAll = checked
console.log(selectedChecksState.forEach { a -> console.log(a) })
+"You have selected $selectedChecksState"
}
}
Typography {
variant = TypographyVariant.button
+"Select All?"
}
}
Box {
for (item in <http://Title.ET|Title.ET>) {
Box {
Checkbox {
checked = checkAll
onChange = { _, checked ->
if (checked) {
selectedChecksState.add(item)
} else if (!checked && selectedChecksState.isNotEmpty())
selectedChecksState.remove(item)
console.log(selectedChecksState.forEach { a -> console.log(a) })
+"You have selected $selectedChecksState"
}
}
+"${item}"
}
}
}
andylamax
03/30/2023, 10:53 PMcheckAll
. Looks like thats not the behavior you want. Try giving every Checkbox its own individual stateDmitriy Malayev
03/30/2023, 10:54 PMandylamax
03/30/2023, 10:54 PMDmitriy Malayev
03/30/2023, 10:57 PMandylamax
03/30/2023, 11:08 PMDmitriy Malayev
03/30/2023, 11:09 PM