Hi all! I have a question about accessibility (tog...
# compose
j
Hi all! I have a question about accessibility (toggleable) that should be simple but I can't find the solution: I have a Row with a text and a switch, and the whole row is clickable and controls the switch state. For accessibility I set
.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:
Copy code
Modifier.clearAndSetSemantics {
                        contentDescription = text
                        this.role = Role.Switch
                        this.onClick = onValueChange
                        stateDescription = if (selected) {
                            "On"
                        } else {
                            "Off"
                        }
                    }
g
I don't think you can programmatically, I guess they want all apps and UI to behave consistently However... the user can change it in accessibility settings if they want as I found out here https://kotlinlang.slack.com/archives/CJLTWPH7S/p1727882746646089?thread_ts=1725981160.971199&cid=CJLTWPH7S