Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix accessibility for dialogs #1678

Merged
merged 10 commits into from
Nov 6, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -1176,9 +1176,15 @@ internal class AccessibilityMediator(
fun onLayoutChange(nodeId: Int) {
debugLogger?.log("onLayoutChange (nodeId=$nodeId)")

invalidatedBoundsNodeIds.add(nodeId)
// TODO: Properly implement layout invalidation, taking into account that semantics
// can also change after the `onLayoutChange` event.
if (accessibilityElementsMap[nodeId] == null) {
// Forcing tree recalculation when a node with unknown nodeId occurred.
invalidationKind = SemanticsTreeInvalidationKind.COMPLETE
} else {
invalidatedBoundsNodeIds.add(nodeId)
}

// unprocessedInvalidationKind will be set to BOUNDS in sync(), it's a strict subset of COMPLETE
invalidationChannel.trySend(Unit)
}

Expand Down
Loading