Repository navigation
Commit 855cb10
committed
[web] Don't debounce physical mouse clicks in ClickDebouncer
When semantics is enabled, `ClickDebouncer` withholds pointer events that
land on an `flt-tappable` node and, on the subsequent DOM "click",
synthesizes a generic `SemanticsAction.tap` in their place. The framework
turns that into a tap at the center of the widget with
`PointerDeviceKind.unknown`, so a `GestureDetector` under a physical mouse
cursor reports `Tap*Details` with the wrong position and kind.
Forward physical mouse input straight to the framework instead. The
subsequent "click" is then deduped by `_shouldSendClickEventToFramework`,
because the forwarded `pointerup` sets `_lastSentPointerUpTimeStamp`.
Trade-off, documented at the call site: mouse input can no longer reach
`SemanticsAction.tap` by any route, so a semantics node exposing a tap
action with no hit-testable gesture recognizer under the cursor stops
responding to mouse clicks. Only `mouse` is exempted; `pen` and `touch`
still debounce.
Also removes a 200ms delay on every mouse press over a tappable node.
Tests: the existing `_testClickDebouncer` cases were written against
`context.primaryDown()`, which is `pointerType: 'mouse'`, so they now
exercise touch instead via local `touchDown`/`touchUp` helpers. Adds a
regression test that mouse input reaches the framework as pointer packets
and that the following "click" does not also fire a semantics tap.
Fixes flutter#1888591 parent de6cb8b commit 855cb10
2 files changed
Lines changed: 82 additions & 14 deletions
File tree
- engine/src/flutter/lib/web_ui
- lib/src/engine
- test/engine
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
218 | 223 | | |
219 | 224 | | |
220 | 225 | | |
| |||
255 | 260 | | |
256 | 261 | | |
257 | 262 | | |
258 | | - | |
| 263 | + | |
| 264 | + | |
259 | 265 | | |
260 | 266 | | |
261 | 267 | | |
| |||
337 | 343 | | |
338 | 344 | | |
339 | 345 | | |
340 | | - | |
| 346 | + | |
341 | 347 | | |
342 | 348 | | |
343 | 349 | | |
| |||
349 | 355 | | |
350 | 356 | | |
351 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
352 | 391 | | |
353 | 392 | | |
354 | 393 | | |
| |||
403 | 442 | | |
404 | 443 | | |
405 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
406 | 450 | | |
407 | 451 | | |
408 | 452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3128 | 3128 | | |
3129 | 3129 | | |
3130 | 3130 | | |
3131 | | - | |
| 3131 | + | |
| 3132 | + | |
3132 | 3133 | | |
3133 | 3134 | | |
3134 | 3135 | | |
3135 | 3136 | | |
3136 | 3137 | | |
3137 | 3138 | | |
3138 | 3139 | | |
3139 | | - | |
3140 | | - | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + | |
| 3143 | + | |
| 3144 | + | |
| 3145 | + | |
| 3146 | + | |
3141 | 3147 | | |
3142 | | - | |
3143 | | - | |
| 3148 | + | |
| 3149 | + | |
3144 | 3150 | | |
3145 | | - | |
3146 | | - | |
3147 | | - | |
3148 | | - | |
3149 | | - | |
3150 | | - | |
3151 | | - | |
| 3151 | + | |
| 3152 | + | |
| 3153 | + | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
| 3165 | + | |
| 3166 | + | |
| 3167 | + | |
| 3168 | + | |
| 3169 | + | |
| 3170 | + | |
| 3171 | + | |
| 3172 | + | |
| 3173 | + | |
| 3174 | + | |
| 3175 | + | |
3152 | 3176 | | |
3153 | 3177 | | |
3154 | 3178 | | |
| |||
0 commit comments