Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Recently there were some changes made so that content descriptions aren't merged - the parent always wins, even if it's
null
:If we take a simple example like this:
It produces the following logs:
When we're using the merged tree, the clickable
Box
has no content description, but on device the content description works as expected - when focused, it reads out 'Dismiss, double tap to activate'.This is pretty surprising to me, but looking at the linked CLs this looks like intended behaviour. My assumption was that what you see in the merged tree is what a user sees when they use an accessibility service, but it seems that's not accurate. From a testing perspective, this doesn't seem great - there doesn't seem to be a straightforward way for me to test what the user actually sees when using an accessibility service through Compose testing APIs, since some of the logic is in the Android interop layer (
AndroidComposeViewAccessibilityDelegateCompat
).I'm also left pretty confused about how merging is supposed to work and how merge policies are chosen. Looking through the various instances of here is kinda misleading, since the example using multiple
SemanticsPropertyKey
it seems like pretty much the only one that actually does any merging at this point isSemanticsProperties.Text
. The documentationText
s is one of the few where things truly get merged at the moment (rather than something more like 'pick the first one, depth-first').I wasn't sure whether to file this under testing or somewhere else - it's really an accessibility thing, but since it works as expected on device so I went for testing.