Skip to content

[web] GestureDetector doesn't respect HitTestBehavior property  #45893

@mikepyts

Description

@mikepyts

Pre-history:
This is one of the issues:
#45896
#45897
#45898
which have been found on the way to make ListView in Flutter for web scrollable with a finger on touch screen, alternative for this is scrolling a list with a mouse pointer.

Description of the issue:
When you have 2 Gesture detectors nested one inside another one and provide HitTestBehavior.translucent onTap action from the parent GestureDetector is not triggered. Inside the example, parent GestureDetector should increment a counter by two and child Gesture Detector by one at a single click.

Steps to Reproduce

  1. Create a new Flutter project
  2. Copy content of the gist https://gist.github.com/mikepyts/7b63b8e5086d4606c0d25631d27d5755 to the main.dart.
  3. Uncomment issue number 1
  4. Correct import issues
  5. Run the project
  6. Click on the red container
  7. Observe the behaviour of the counter

Expected results
Counter is incremented by 3 on each tap (1 from parent GD and 2 from child GD).

Actual results
Counter is incremented by 1 what equals to the action from child GD.

image

Target Platform: Web
Target OS version/browser: MacOS Catalina, Chrome

Flutter doctor

[✓] Flutter (Channel master, v1.12.16-pre.35, on Mac OS X 10.15.1 19B88, locale en-UA)
    • Flutter version 1.12.16-pre.35 at /Users/mike/Documents/flutter_master
    • Framework revision b9a56b9f48 (2 days ago), 2019-11-29 20:40:44 -0500
    • Engine revision 8672e79af8
    • Dart version 2.7.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (2 available)
    • Chrome     • chrome     • web-javascript • Google Chrome 78.0.3904.108
    • Web Server • web-server • web-javascript • Flutter Tools

Metadata

Metadata

Assignees

No one assigned

    Labels

    f: gesturesflutter/packages/flutter/gestures repository.frameworkflutter/packages/flutter repository. See also f: labels.platform-webWeb applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions