Commit 8b698cf
authored
fix(tldraw): expose UI to mobile screen readers via role=document (tldraw#8901)
In order to make the tldraw UI reachable to mobile screen readers, this
PR marks the `tlui-layout` wrapper with `role="document"`. The outer
`tl-container` has `role="application"`, which VoiceOver (iOS) and
TalkBack (Android) do not announce at all, leaving the toolbar, menus,
and dialogs effectively invisible to mobile assistive tech. Per the [MDN
guidance](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/application_role#description),
interspersing `role="document"` inside an `application` region restores
normal document semantics for non-application UI while leaving the
application's keyboard-interaction model on the outer container
untouched. Closes tldraw#8849.
### Change type
- [x] `bugfix`
### Test plan
1. Open the examples app with VoiceOver enabled on iOS Safari and
confirm the toolbar, page menu, and dialogs are announced and navigable.
2. Repeat on Android Chrome with TalkBack.
3. With a desktop screen reader (NVDA or macOS VoiceOver), confirm the
canvas is still announced as an application and shapes are still
keyboard-interactive.
- [ ] Unit tests
- [ ] End to end tests
### Release notes
- Mark the tldraw UI layer with `role="document"` so toolbars, menus,
and dialogs stay reachable to mobile screen readers like VoiceOver and
TalkBack, which do not announce the outer canvas `role="application"`.
### Code changes
| Section | LOC change |
| ------------- | ---------- |
| Core code | +6 / -0 |
| Documentation | +1 / -0 |1 parent b9e8265 commit 8b698cf
2 files changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
187 | 193 | | |
188 | 194 | | |
189 | 195 | | |
| |||
0 commit comments