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

SuperTextField onRightClick should be invoked on tap down #278

Open
knopp opened this issue Aug 8, 2021 · 7 comments · May be fixed by #692
Open

SuperTextField onRightClick should be invoked on tap down #278

knopp opened this issue Aug 8, 2021 · 7 comments · May be fixed by #692
Labels
area_supertextfield Pertains to SuperTextField status_needs_analysis A maintainer needs to break down this ticket into action items.

Comments

@knopp
Copy link
Contributor

knopp commented Aug 8, 2021

We need to display native context menu on right mouse click (macOS). In macOS the context menu is displayed during mouseDown event, however onRightClick is only invoked from onSecondaryTapUp, which is too late.

@knopp
Copy link
Contributor Author

knopp commented Aug 11, 2021

On the other hand, context menu on windows is opened on mouse up. So either onRightClick would need to be invoking under different condition on different platform or we'd need callback for onRightClickDown and onRightClick(Up).

@matthew-carroll
Copy link
Contributor

If the events can differ, then is the best move to remove this responsibility from the textfield altogether? Is there a reason why the textfield should launch the context menu?

@matthew-carroll matthew-carroll added area_supertextfield Pertains to SuperTextField status_needs_analysis A maintainer needs to break down this ticket into action items. labels Sep 1, 2021
@knopp
Copy link
Contributor Author

knopp commented Sep 8, 2021

I wouldn't mind moving this outside of textfield. There's one small challenge here - on macOS control + left button also opens context menu. This will only work with recognizer outside of text field if the recognizer inside the text field ignores left mouse down while control is pressed.

@venkatd
Copy link

venkatd commented Sep 24, 2021

I don't think this behavior belongs inside of SuperTextField because the requirements will vary between projects. For example, we've got our own custom right click menu that's pure Flutter. Others may prefer to use a native right click menu and this may vary among platforms.

SuperTextField could provide some handlers for right click and expose information like coordinates and the caret position. Context menus sounds like they could live in an entirely separate package.

@matthew-carroll
Copy link
Contributor

@venkatd I'll think this over and see what might make sense. I think it's clear that we don't want to bake in any such behavior, but my guess is that devs will expect an opportunity for a default, right? I don't know what the population breakdown is, but if 80% of developers want the same behavior then we probably don't want to make them re-implement it every time. We could offer one or more composited widgets that add the behavior, etc.

In any event, can this wait until after we merge mobile support for textfields?

@knopp
Copy link
Contributor Author

knopp commented Sep 24, 2021

This issue is not about menu itself, it is about when the handler gets invoked. The way context menus are triggered differs amongst platform (i.e. right button down or ctrl + left button down on macOS, right button up / keyboard shortcut on windows). It should be possible to handle this outside of SuperTextField as well, but then there might be an issue with ctrl + left button down for example since SuperTextField already has left button down recognizer.

@bk-one
Copy link
Contributor

bk-one commented Feb 2, 2022

@knopp is this still relevant?

@matthew-carroll matthew-carroll self-assigned this Jul 7, 2022
matthew-carroll added a commit that referenced this issue Jul 9, 2022
…oved right-click behavior to the new system (Resolves #278)
@matthew-carroll matthew-carroll removed their assignment Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area_supertextfield Pertains to SuperTextField status_needs_analysis A maintainer needs to break down this ticket into action items.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants