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

Keyboard is hidden when I tap Android Home or Overview button but not keyboard actions header #1

Closed
ghunter99 opened this issue Dec 15, 2018 · 5 comments

Comments

@ghunter99
Copy link

Hi @diegoveloper,

Thanks for writing this great package!

The only problem I've experienced is when the keyboard is displayed and:

  1. I switch out of an app, using the Android Home button or the Overview button (that's the third button at the bottom from the left)
  2. I can see that the keyboard is hidden
  3. When I return to the app the keyboard actions are sitting at the bottom of the screen without the keyboard being displayed.

The problem occurs in the example app and the apps that I've used the package in.

It seems like the package is not able to detect the keyboard being hidden in this situation.

I'm hoping it's simple for you to reproduce.

I've tried it on a few different versions of Android. My set up is fairly standard:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.0.0, on Mac OS X 10.14 18A391, locale en-AU)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] Connected device (2 available)

Thanks

@diegoveloper
Copy link
Owner

Hello, thanks for catch this issue. Are you able to reproduce on iOS ?

@diegoveloper
Copy link
Owner

diegoveloper commented Dec 15, 2018

Hey, I fixed the issue, it looks like only happens on Android.
To test the new changes please change this on your pubspec.yaml file :

keyboard_actions:
    git: https://github.com/diegoveloper/flutter_keyboard_actions.git

After you confirm it's working fine, I'll close the issue and upload a new version to the pub.

Thanks

@ghunter99
Copy link
Author

Wow, that was fast 😄

Looks like it's almost working.

Yes, it only happens on Android.
On iOS, keyboard is not hidden when press home or recent button.
Would be good if Flutter on Android behaved the same way.
I notice Chrome on Android does not hide keyboard when press home or recent button.
But nothing we can do about that.

I tested and keyboard actions are hidden correctly when press home or recent button.

On switch back to app however, old text field has focus but if I tap on old text field, keyboard is
shown without keyboard actions (somehow focus node listener function is not called)

If I tap on a different text field everything works.

Hope you can replicate.

Maybe just call:
FocusScope.of(context).requestFocus(_currentAction.focusNode);
when detect state change to pause?

Thanks again for this great package.

-Gary

@diegoveloper
Copy link
Owner

Fixed now, could you try again?

@ghunter99
Copy link
Author

👍 Works great. Thanks!

jaysephjw added a commit to jaysephjw/flutter_keyboard_actions that referenced this issue May 23, 2019
diegoveloper pushed a commit that referenced this issue Jun 15, 2019
aimsugita added a commit to aimsugita/flutter_keyboard_actions that referenced this issue Dec 27, 2019
```
════════ Exception caught by services library ══════════════════════════════════════════════════════
The following NoSuchMethodError was thrown during a platform message callback:
The getter 'footerBuilder' was called on null.
Receiver: null
Tried calling: footerBuilder

When the exception was thrown, this was the stack: 
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
diegoveloper#1      KeyboardActionstate._focusChanged (package:keyboard_actions/keyboard_actions.dart:219:26)
diegoveloper#2      KeyboardActionstate.didChangeAppLifecycleState (package:keyboard_actions/keyboard_actions.dart:373:9)
diegoveloper#3      WidgetsBinding.handleAppLifecycleStateChanged (package:flutter/src/widgets/binding.dart:536:16)
diegoveloper#4      SchedulerBinding._handleLifecycleMessage (package:flutter/src/scheduler/binding.dart:285:5)
...
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ (2) Exception caught by services library ══════════════════════════════════════════════════
The getter 'footerBuilder' was called on null.
Receiver: null
Tried calling: footerBuilder
════════════════════════════════════════════════════════════════════════════════════════════════════
``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants