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

fix(ios): iOS 13.4 subkey menu workaround #2959

Merged
merged 2 commits into from
Apr 15, 2020

Conversation

jahorton
Copy link
Contributor

@jahorton jahorton commented Apr 7, 2020

A temporary workaround for #2716.

Unfortunately, Apple broke something in iOS 13.4 that we've been heavily relying upon for longpresses on the keyboard. Longpresses that start within a WKWebView can now be blocked by JS events, which completely broke all subkey menus.

This PR will adapt Keyman for iOS to rely on Web-side longpress detection instead. Unfortunately, web-side longpresses can't exactly control Swift-side UI, but we can at least trigger display of the subkey menus.

With this workaround in place, once the subkey menu displays, the user must start a second touch within that menu in order to select whatever key/option they desire. We simply can't tie the menu-generating longpress to the Swift UI, unfortunately. So, it won't be as smooth as before, but at least it'll work on iOS 13.4, which is (hopefully) an acceptable tradeoff. We'll want a more robust solution in the long-term, but far more work than this will be required to make that happen.

Currently addressed:

  • Popup keys now usable
  • Globe-based keyboard menu now usable

@jahorton jahorton added this to the P10S4 milestone Apr 7, 2020
@jahorton jahorton marked this pull request as ready for review April 7, 2020 03:33
@jahorton jahorton requested a review from mcdurdin April 7, 2020 03:35
@mcdurdin
Copy link
Member

mcdurdin commented Apr 7, 2020

I don't think that's going to be a workable solution, sorry :(

@jahorton
Copy link
Contributor Author

jahorton commented Apr 7, 2020

Hmm... it'll definitely still need some work. Interestingly, while it can display popup keys out of the base keyboard bounds in-app, touches don't seem to work... but only when started outside of those bounds. (You can tap inside the bounds and then move the touch, at which point it will follow.)

Also, there's the matter of undoing a popup-key menu display; we'd also (ideally) add a 'cancel' operation.

@mcdurdin
Copy link
Member

mcdurdin commented Apr 7, 2020

Test notes - mostly reflecting what you've already written. Testing on iOS 12.4.

  1. Long press is now visible again and can be selected. Requires a release and new gesture to select an item.
  2. Long press can only be cancelled by releasing and pressing on the active base key. Particularly tricky for a two-level long press menu on the top row, where there are only a handful of pixels that you can touch to cancel, because the menu is shifted down over the base key in order to fit in bounds!
  3. Long press outside keyboard bounds on in-app keyboard popup has no effect; as you found, you must drag from within the keyboard bounds, starting somewhere on the long press menu itself, in order to select these long press keys. Tricky!

Assuming we can resolve points 2 & 3 above, can we disable the workaround for iOS < 13.4 so that users on older versions aren't adversely affected by this?

Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Let's keep monitoring the iOS 13.4.x situation along with your bug report and see if it gets resolved and we can roll back in the future.

Is it possible to link Apple's bug report id in somewhere? I know it's private to you but we can still refer to it in communications with Apple in the future.

@jahorton
Copy link
Contributor Author

I'm not finding a way to link it yet, but here's the raw data that we could use with them:

Apr 3, 2020 at 1:44 PM – FB7650067

@jahorton jahorton merged commit 00b7208 into master Apr 15, 2020
@jahorton jahorton deleted the fix/ios/2716-web-based-longpress branch April 15, 2020 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants