Skip to content

Commit 16a8a18

Browse files
committed
Fix a11y root element having 0×0 dimensions on web
The `cmp_a11y_root` container was created with `position: absolute` but never given width or height, making it invisible to hit-test-based accessibility tools (Accessibility Inspector, Appium). VoiceOver still worked because it traverses the DOM tree sequentially. Sync the a11y container's CSS dimensions with the canvas in `resize()`, which runs on both initial layout and every subsequent resize. Fixes https://youtrack.jetbrains.com/issue/CMP-10172 Assisted-by: cursor
1 parent 910d0b2 commit 16a8a18

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

compose/ui/ui/src/webMain/kotlin/androidx/compose/ui/window/ComposeWindowInternal.web.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,11 @@ internal class ComposeWindow(
501501
canvas.style.width = "${boxSize.width.value}px"
502502
canvas.style.height = "${boxSize.height.value}px"
503503

504+
a11yContainerElement?.let {
505+
it.style.width = "${boxSize.width.value}px"
506+
it.style.height = "${boxSize.height.value}px"
507+
}
508+
504509
_windowInfo.containerSize = sizeInPx
505510
_windowInfo.containerDpSize = boxSize
506511

0 commit comments

Comments
 (0)