Jordi Saumell
07/07/2025, 12:14 PM.toggleable(isSelected, Role.switch, onValueChange)
.
The problem is the reading order: it first reads "on/off", then the label text, then "switch", and finally the click action.
I don't see how to change the order: my understanding is that it should read as label - state - "switch" - action.
I have tried many things, even setting it manually (which I don't like, as I want to use the standard state description instead of providing a custom one), and it keeps reading the state first:
Modifier.clearAndSetSemantics {
contentDescription = text
this.role = Role.Switch
this.onClick = onValueChange
stateDescription = if (selected) {
"On"
} else {
"Off"
}
}
gregmcgowan
07/09/2025, 12:43 PM