Repository navigation
Commit a9f7270
authored
[web] Scope the mobile semantics placeholder to its view (flutter#190856)
Fixes flutter#152838
**Problem**
Flutter Web puts an invisible "Enable accessibility" button on the page
for screen reader users. On mobile it covered the whole page instead of
just the Flutter app, swallowing taps meant for the surrounding HTML
until about 20 taps made the engine remove it.
Desktop was never affected: its button is one pixel and sits offscreen.
**Fix**
The button now lives inside `<flutter-view>` rather than `<body>`, one
per view, so it can only cover the Flutter app. The CSS is unchanged,
only the parent element, and it goes in as the first child so platform
views keep their own events.
**Demo**
Before: https://flutter-demo-59-before.web.app
After: https://flutter-demo-59-after.web.app
Open either on a phone and tap the HTML links before touching the
Flutter app.
- Before: nothing responds. The links do not highlight and the log stays
at "no HTML link clicked yet". They come alive only after tapping the
Flutter app about 20 times.
- After: the links respond on the first tap.
Desktop browsers cannot show the difference, since they use the 1x1
placeholder on both builds.1 parent c251c17 commit a9f7270
8 files changed
Lines changed: 564 additions & 107 deletions
File tree
- engine/src/flutter/lib/web_ui
- lib/src/engine
- semantics
- view_embedder
- test/engine
- platform_dispatcher
- semantics
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| |||
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | 91 | | |
97 | 92 | | |
98 | 93 | | |
| |||
114 | 109 | | |
115 | 110 | | |
116 | 111 | | |
117 | | - | |
118 | 112 | | |
119 | 113 | | |
120 | 114 | | |
| |||
0 commit comments