Repository navigation
fix(client): fire GestureDetector.on_tap_move events - #6982
Merged
FeodorFitsner merged 5 commits intoOct 18, 2026
Merged
Conversation
…izer Flutter's GestureDetector never forwards its onTapMove parameter to the TapGestureRecognizer it creates: the parameter is missing both from the recognizer registration condition and from the recognizer configuration, so GestureDetector.onTapMove is dead code and Flet's GestureDetector.on_tap_move never fired (flet-dev#6961). When on_tap_move is subscribed, the whole primary tap family (on_tap_down/on_tap_up/on_tap/on_tap_cancel/on_tap_move) is now wired into a TapGestureRecognizer registered by a RawGestureDetector wrapping the content, so exactly one tap recognizer competes in the gesture arena and tap/tap_down/tap_up/tap_cancel behavior is preserved. Fixes flet-dev#6961
Contributor
|
Pushed fixes for the two review findings in 8d2cb43:
Added regression tests and moved the changelog entry to 1.1.0. All 39 tests across The PR now targets |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Toggling the tap-move subscription recreates the content subtree, losing local widget state.
1 open issue
What changed in this PR
Fixes #6961 by routing tap-move events through a raw tap recognizer so they reach Python handlers.
Changes:
- Routes tap callbacks through one recognizer when tap moves are subscribed.
- Adds regression tests for gestures, accessibility, and device filtering.
- Documents the fix in the 1.1.0 changelog.
| File | Description |
|---|---|
| packages/flet/test/widgets/gesture_detector_test.dart | Adds gesture and accessibility regression tests. |
| packages/flet/lib/src/controls/gesture_detector.dart | Implements conditional raw tap recognition. |
| CHANGELOG.md | Records the tap-move fix. |
Review effort: Balanced
FeodorFitsner
approved these changes
Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fixes #6961:
GestureDetector.on_tap_movenow reaches its Python handler.Flutter's
GestureDetectordoes not forwardonTapMoveto itsTapGestureRecognizer. When tap moves are subscribed, Flet routes all primary, secondary, and tertiary tap callbacks through one recognizer registered byRawGestureDetector. This preserves a single functioning accessibility tap action when secondary or tertiary handlers are also subscribed.The recognizer's
supportedDevicesis refreshed on every rebuild so changes toallowed_devicestake effect. Media query gesture settings andexclude_from_semanticsare preserved. The raw wrapper stays mounted when tap-move subscriptions change, preserving content state and focus. When tap moves are not subscribed, callbacks continue to use Flutter'sGestureDetector.Includes a changelog entry under 1.1.0. Targets
flet-1.1.0.Validation
On Flutter 3.47.7, as pinned by the target release:
list_tile_test.dartandcontrol_test.dartsuites pass (41 tests total across the three suites).Summary by Sourcery
Fix tap-move event delivery in gesture detectors without disrupting existing tap, accessibility, or child-state behavior.
Bug Fixes:
GestureDetector.on_tap_moveevents so they reach Python handlers while preserving primary, secondary, and tertiary tap behavior and accessibility semantics.allowed_deviceschanges.Enhancements:
Tests: