-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
When open keyboard, automatically closed #37
Comments
Wow thats interesting. Can you share any code snipped you have, confirm the version of the package, and the device you are using? |
[✓] Flutter (Channel stable, 1.20.1, on Mac OS X 10.15.6 19G2021, locale es-419) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1) |
The device is a Mi A2 with Android One, Android 10., Is when click on TextFormField, or TextField |
I use this lib for when keyboard is open, I hide widgets, for the content adjust to write more confortable, when keyboard is hide, I show widgets again |
Then the method listen, return true when open and immediately false and It close, Thanks. |
May be related: flutter/flutter#9471 |
I am having this same problem as well, but it didn't seem to persist on iOS, only Android. |
I would love a reproducible sample to help work on this. |
I am facing this issue too - on iOS. Have not tried on Android. @MisterJimson here is this issue reproduced: https://github.com/ajaygautam/flutter_repro_keyboard_dismiss_issue Relevant details have been added to the readme in the repo. I have added you as a collaborator to the repo. Please do feel free to commit changes. Primary code segments: class RouteWithKeyboardVisibilityBuilder extends StatelessWidget {
final String title;
const RouteWithKeyboardVisibilityBuilder({Key key, this.title = "RouteWithKeyboardVisibilityBuilder"})
: super(key: key);
@override
Widget build(BuildContext context) {
return KeyboardVisibilityBuilder(builder: (context, isKeyboardVisible) {
print("=-=-=-=-=-= Building with keyboard visibility set to: --||$isKeyboardVisible||-- for screen with title $title =-=-=-=-=-=");
return Material(
child: Container(
color: Colors.blue[200],
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(title),
SizedBox(height: 16),
WidgetWithTextEdit(),
SizedBox(height: 16),
BackNextButtonRow()
]))));
});
}
}
class WidgetWithTextEdit extends StatelessWidget {
final Key key = UniqueKey();
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return SizedBox(
height: screenSize.height * 0.1,
width: screenSize.width * 0.67,
child: new TextFormField(
key: key,
decoration: InputDecoration(hintText: "Tap to Enter Data"),
),
);
}
} Would appreciate any help / info. Let me know if you want me to try anything. |
@tmthecoder were you able to resolve this? |
Not yet, I'm still awaiting a resolution |
So... looks like package keyboard_visibility does not cause this behavior - atleast in the test app at: https://github.com/ajaygautam/flutter_repro_keyboard_dismiss_issue I have updated the app to support both keyboard_visibility and flutter_keyboard_visibility. Going to try this with my actual app now. Thanks |
@ajaygautam can you provide steps to reproduce the issue with your example repo? I am running it and have tried switching I am not seeing any issues. I can clock next and tap in the text field and the keyboard shows correctly. |
That is strange! It seems to be working fine now. FWIW...
|
Ok. I am going to leave it open as there is still and issue with Android it seems from the other people in this thread. |
Any feedback is appreciated before I merge this into a main version. I suspect it may help resolve this issue. |
Should be closed in 4.0.4, but I had trouble reproducing. Feel free to reopen with more info. |
Before the flutter 2.0 update arrive this code is working fine but after the flutter 2.0 update and this package update to support null safety, the keyboard now closes when transitioning to a new layout that has 3 columns from only 2 columns keyboard.mp4this is the code I used to replicate the problem: https://github.com/haliknihudas666/flutter_keyboardVisibility_demo please reopen this issue |
I have the same issue today (on Android), and i resolve by changing from Stateless Widget to Statefull Widget the Form where the TextInput have the problem |
Thanks @BrunoC96 for the help, it worked 🎉. But dont know why this behavior for the Stateless widget. |
Unfortunately does not work for me. Tried all workaround until this message.
|
Hi there, I had the same issue and I was able to fix it by creating a This StackOverflow post has the details: https://stackoverflow.com/questions/51320692/flutter-keyboard-disappears-immediately-when-editing-my-text-fields |
I have the exact same problem. When keyboard is shown I remove a big widget from the widget tree, that causes the keyboard to be dismissed. Edit: I found an workaround. If I add a |
I receive in console
W/IInputConnectionWrapper(14786): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(14786): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(14786): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper(14786): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper(14786): endBatchEdit on inactive InputConnection
The keyboard not stay open when open, any idea? If disable o remove the listen, the keyboard stay open.
The text was updated successfully, but these errors were encountered: