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
Comments
On the other hand, context menu on windows is opened on mouse up. So either |
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? |
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. |
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. |
@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? |
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. |
@knopp is this still relevant? |
…oved right-click behavior to the new system (Resolves #278)
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 fromonSecondaryTapUp
, which is too late.The text was updated successfully, but these errors were encountered: