-
Notifications
You must be signed in to change notification settings - Fork 13
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
How unfocus the HtmlEditor to close keyboard? #26
Comments
Have you tried FocusScope? FocusScope.of(context).unfocus(); Haven't tried it myself yet, but it's worth a shot. |
Yes already tried that and this to:
|
Still haven't found a solution to this problem. Having other input fields and tapping on them works as expected, but I didn't manage to just unfocus the HTML editor. I assume this may be related to using the hybrid composition of the What platform do you mainly work on (Android or iOS)? |
Good news: For Android I have found a solution. Bad news: for this I had to change the There is now a TextButton(
child: Text('Close'),
onPressed: () => _editorApi?.unfocus(),
), You can test this by using this dependency in your
|
I believe the package is overwriting some flutter classes, so this error occurs:
|
You are right, the package enough_platform_widgets also needs to be used in
Run |
I
My project cannot be upgraded to SDK 2.12.0 due to incompatibility of some dependencies. So I couldn't test your suggestion. |
ok, please verify once you have upgraded your Flutter environment. |
I just realized that your compile error is mostly due to a flutter_colorpicker bug. I have now downgraded the flutter_colorpicker version in the pubspec.yaml on HEAD, you might want to try again. |
I think this should be work SystemChannels.textInput.invokeMethod('TextInput.hide'); |
Thanks a lot, this seems to work fine - I added your code now! |
I need to close keyboard by onTap in Parent, but not found where to configure FocusNode of editor.
I have:
final GlobalKey<HtmlEditorState> _keyEditor = GlobalKey<HtmlEditorState>();
with:
HtmlEditor(key: _keyEditor,)
The text was updated successfully, but these errors were encountered: