Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting GestureRecognizers to respect each other #107671

Open
matthew-carroll opened this issue Jul 14, 2022 · 8 comments
Open

Getting GestureRecognizers to respect each other #107671

matthew-carroll opened this issue Jul 14, 2022 · 8 comments
Labels
a: desktop Running on desktop a: text input Entering text in a text field or keyboard related problems f: gestures flutter/packages/flutter/gestures repository. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list team-framework Owned by Framework team triaged-framework Triaged by Framework team

Comments

@matthew-carroll
Copy link
Contributor

matthew-carroll commented Jul 14, 2022

In super_editor, we're trying to add support to SuperTextField on desktop to allow arbitrary gesture interactions on top of the text field. For example, an app should be able to implement ALT + LEFT CLICK to open a context menu.

Currently, this is a challenge because we can't seem to prevent both the app-level gestures and the SuperTextField internal gestures from both responding to user interactions. I have a PR that illustrates our attempt to do this: superlistapp/super_editor#692

FYI - There's a test in the PR that's currently failing. That should demonstrate the issue.

I think we need the insight of the Flutter team to determine if there's presently a mechanism that would allow these two GestureRecognizers to cooperate in the gesture arena, or whether this use-case is impossible with the current gesture system.

@matthew-carroll
Copy link
Contributor Author

@Hixie - I thought you might know the answer to this. I know that you and I have discussed the gesture arena in the past.

@Hixie
Copy link
Contributor

Hixie commented Jul 14, 2022

I don't understand. What exactly doesn't work? Can you create a reduced test case that demonstrates the case you expect to work, that doesn't?

@matthew-carroll
Copy link
Contributor Author

The test in the linked PR is pretty reduced. The test fails because the gesture that's supposed to ONLY open a context menu, also places the caret within the text field. Thus, both gesture detectors are handling the same gesture.

@Hixie
Copy link
Contributor

Hixie commented Jul 14, 2022

i meant reduced to just importing package:flutter/widgets.dart :-)

@matthew-carroll
Copy link
Contributor Author

This particular use-case is using a custom gesture recognizer in our text field to recognize series of taps: single, double, triple. So I can't provide a vanilla Flutter example without possibly changing the nature of the bug.

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Jul 15, 2022
@darshankawar
Copy link
Member

Labeling it for better tracking and for continued discussion on this case.

@darshankawar darshankawar added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. f: gestures flutter/packages/flutter/gestures repository. a: desktop Running on desktop and removed in triage Presently being triaged by the triage team labels Jul 15, 2022
@gspencergoog gspencergoog added the P2 Important issues not at the top of the work list label Jul 21, 2022
@Hixie
Copy link
Contributor

Hixie commented Jul 21, 2022

@matthew-carroll what i mean is an example of what you're trying to do. Presumably there's a particular configuration of GestureDetectors and widgets/renderobjects that doesn't do what you want?

@flutter-triage-bot
Copy link

The triaged-desktop label is irrelevant if there is no team-desktop label or fyi-desktop label.

@goderbauer goderbauer added the triaged-framework Triaged by Framework team label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: desktop Running on desktop a: text input Entering text in a text field or keyboard related problems f: gestures flutter/packages/flutter/gestures repository. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list team-framework Owned by Framework team triaged-framework Triaged by Framework team
Projects
None yet
Development

No branches or pull requests

6 participants