-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Dismiss text selection toolbar with ESC #98511
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
Dismiss text selection toolbar with ESC #98511
Conversation
justinmc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
One comment below about iOS/Android with a native keyboard, but I realize that's probably pretty niche.
| ReplaceTextIntent: _replaceTextAction, | ||
| UpdateSelectionIntent: _updateSelectionAction, | ||
| DirectionalFocusIntent: DirectionalFocusAction.forTextField(), | ||
| DismissIntent: CallbackAction<DismissIntent>(onInvoke: (_) => hideToolbar(false)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried this on a native iOS app on iPad with a physical keyboard, and pressing escape did nothing. Maybe do a switch statement here and don't hide the toolbar on iOS? And try to figure out what happens on Android if you can.
You can just merge this PR now if you want though since it's otherwise good to go. Maybe open a separate PR to do the switch statement or open an issue for it. Up to you.
|
Merging this for now, it seems like it isn't supposed to dismiss the menu on both Android and iOS but for some reason, it already doesn't? Looking into this more tomorrow. |
|
Sounds good, interesting that the menu isn't dismissed already... |
This reverts commit 9407700.
…tter#98600) This reverts commit 9407700.
Dismiss the EditableText selection controls toolbar by pressing ESC using the DismissIntent. @justinmc since this is a global shortcut in
app.dartit should circumvent the concern about not always dismissing the menu?This does come with side-effects like no longer being able to dismiss something like a
DialogueRoutewith ESC when it contains a text field that is focused. Maybe that makes more sense if you can unfocus EditableText by pressing ESC as well.Fixes #98163
Pre-launch Checklist
///).