Hey guys, do you know how we can check if contentd...
# compose-android
o
Hey guys, do you know how we can check if contentdescription in modifier semantic is not empty? for more context: imagine I want to have a component that can receive modifier and also label. if you give content description in modifier we should use that one for talkback otherwise we use label one.
z
This is kind of backwards from how most composables work. Arguments passed directly to a composable generally take precedence over defaults from the environment.
That said, if your caller really wants this, they can use
clearAndSetSemantics
.
a
w/o having the full picture here, it does sound like a weird request @oday from a API design POV you can provide the affordances of your component via its signature (params). ie, see how
Image
asks for a content description. Makes it explicit that it handles accessibility
o
Yea I thought so myself too, asking here was final resort to prove that the question /usecase may be malformed