Skip to content

Fix GestureDetector long press callback handling - #62897

Merged
dkwingsmt merged 6 commits into
flutter:masterfrom
simpleclub-extended:gesture-detector-long-press
Aug 5, 2020
Merged

dkwingsmt merged 6 commits into
flutter:masterfrom
simpleclub-extended:gesture-detector-long-press

Conversation

@creativecreatorormaybenot

@creativecreatorormaybenot creativecreatorormaybenot commented Aug 4, 2020 •

Copy link
Copy Markdown
Contributor

Description

Supplying any secondary long press callback to GestureDetector would currently override any primary long press callback.
This PR simply fixes this.

cc @dkwingsmt

Related Issues

Tests

I added the following tests:

  • Regression test for the fix.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

  • No, no existing tests failed, so this is not a breaking change.

@flutter-dashboard flutter-dashboard Bot added the framework flutter/packages/flutter repository. See also f: labels. label Aug 4, 2020

@dkwingsmt dkwingsmt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for a nit formatting issue

if (
onTapDown != null ||
if (onTapDown != null ||
onTapUp != null ||

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Indent the other lines so that they're aligned with the first line

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed 🙂

@dkwingsmt
dkwingsmt merged commit b631013 into flutter:master Aug 5, 2020
@creativecreatorormaybenot
creativecreatorormaybenot deleted the gesture-detector-long-press branch August 5, 2020 22:23
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
* Allow GestureDetector to use long press and secondary long press at the same time.
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

onLongPress and onSecondaryLongPress cannot be used together in a Gesture Detector

2 participants