-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
fix(ios): prevents post-restore kbd issues by refreshing kbd #10952
Conversation
User Test ResultsTest specification and instructions
Test Artifacts
|
@@ -74,6 +74,14 @@ class KeymanWebViewController: UIViewController { | |||
super.init(nibName: nil, bundle: nil) | |||
|
|||
_ = view | |||
|
|||
NotificationCenter.default.addObserver( | |||
forName: UIApplication.willEnterForegroundNotification, |
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.
Sadly, I don't believe this can affect #11202 - this is an app notification, rather than a notification intended for use by app-extensions (like third-party keyboards).
Test Results
|
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.
This looks like a reasonable stop-gap, but it would be good to figure out what is causing the instability rather than just bypassing it, long term.
After a bit more searching... maybe I've found something this time? We'd need to test and see if this is being called when our app is restored in this scenarios to be sure it's tied to the behavior that's been seen, of course. Ref: ionic-team/capacitor#5488 (comment)
Noting other issues from ionic and from react, they've seen cases where the WebView is 100% crashed, showing a blank page. We haven't had that issue, though we also aren't navigating across pages or doing other fancy web-server stuff on the back-end - it's just one page for us... albeit with a WebWorker backend and linked-in JS scripts. There's a fair shot that iOS's WebView is doing its best to restore our page after such a termination but is coming up short.
One concerning thing here, though - these are big teams that are struggling to get this scenario right if this is indeed a match for our circumstances. |
Changes in this pull request will be available for download in Keyman version 17.0.311-beta |
Fixes #6542.
Fixes #2184.
This works around a longstanding behavior we've noted on certain iOS devices where our keyboards and/or predictive text become "unstable" in one manner or another after the Keyman app has been restored from a backgrounded state. While not the most elegant of solutions (it has user-perceivable effects), simply refreshing the keyboard host page will remove that "instability".
My personal device has always been affected in one way or another when restoring the Keyman app from the background, though the manner has varied at times. Either way, I'm aiming to finally get that fixed.
User Testing
TEST_IOS_APP_RESTORE: Using the Keyman app for iPhone and iPad, verify that the keyboard works correctly after the app is restored from a background state.
sil_euro_latin
: