Checkbox base padding too high.
When use Checkbox() as it is - it's very big empty space around checkbox. But if I add Modifier.padding(2.dp).size(20.dp) all become to normal. Any manipulations with Modifier.size() doesn't affect on checkbox size, just make padding less or higher. v1.0.0-alpha4-366. Last time I was used it with v0.5.0-262 and all was fine.

Code
Column {
for (i in 1..10) {
Row {
Checkbox(checkboxBoolean, { checkboxBoolean = !checkboxBoolean }, Modifier.padding(2.dp).size(20.dp))
Text("item$i", Modifier.align(Alignment.CenterVertically))
}
}
}
There is a commit which adds additional paddings for accessibility purposes. It seems reasonable for touch devices, but probably looks too high on desktop.
I checked what are the paddings in Material design for web and in Chrome settings. Paddings are high too there.
Anyway, I think we should investigate, if it is the right approach to enforce paddings for material components on desktop.
We have two options:
- leave additional paddings as they are now
- make them smaller for desktop target (we need to take into account ChromeOS too)
To disable paddings, use this:
@OptIn(ExperimentalMaterialApi::class)
CompositionLocalProvider(LocalMinimumTouchTargetEnforcement provides false) {
App()
}
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.