Repository navigation
Commit 7e115a9
authored
[web] Remove the a11y placeholder only after the gesture ends (flutter#194109)
Fixes flutter#194104
## Problem
On mobile, the engine covers each view with a semantics placeholder and
removes it after 20 events that do not activate a screen reader. On
non-WebKit browsers it removed the placeholder on the very next event,
usually a `pointermove` in the middle of a drag. That placeholder is the
drag's target, and when the page lets the browser pan and cancels
`touchmove`, Chrome on Android stops delivering the rest of the drag,
including its `pointerup`, so the framework keeps the pointer down
forever.
## Fix
Remove the placeholder only on `touchend`, `pointerup`, or `click`, once
the gesture that targets it has ended, on every browser engine. WebKit
has used this rule since the placeholder was added. Accessibility was
already given up on, so the only change is that the placeholder goes
away when the finger lifts instead of mid-gesture.
## Demo
On an Android phone in Chrome, reload the page, do one long, slow drag
on the list, and lift the finger.
Before, "Pointers down" stays at 1:
https://flutter-demo-77-before.web.app
After, "Pointers down" returns to 0 and the list is idle:
https://flutter-demo-77-after.web.app1 parent 2f89b8d commit 7e115a9
2 files changed
Lines changed: 53 additions & 6 deletions
File tree
- engine/src/flutter/lib/web_ui
- lib/src/engine/semantics
- test/engine/semantics
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
358 | 364 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
| 365 | + | |
363 | 366 | | |
364 | 367 | | |
365 | 368 | | |
| |||
386 | 389 | | |
387 | 390 | | |
388 | 391 | | |
389 | | - | |
390 | 392 | | |
391 | 393 | | |
| 394 | + | |
| 395 | + | |
392 | 396 | | |
393 | 397 | | |
394 | 398 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
296 | 339 | | |
297 | 340 | | |
298 | 341 | | |
| |||
0 commit comments