Add workaround for WKWebView gesture recognizer issue - #1150
Add workaround for WKWebView gesture recognizer issue#1150jordanstreiff wants to merge 1 commit into
Conversation
13f56be to
3a90d9b
Compare
Reset WKWebView gesture recognizers stuck in the "possible" state after dismissing the native photo picker. Trigger the reset from applicationDidBecomeActive with short retries, toggling isEnabled on any stuck recognizers in the web view hierarchy. Co-authored-by: Cursor <cursoragent@cursor.com>
3a90d9b to
6e7bb83
Compare
|
Thanks @jordanstreiff, brutal bug so great to have a fix, even if somewhat hacky. Before I dig deeper, is the bug also present in a simulator, or did this require a device? |
|
Also present in simulator! |
|
Amazing that the ecosystem ships with those escape hatches where you can add such code! Can't think of any reason not to reset after an 'application became active' - not much severity if you interrupt a gesture recognition either - so i agree it seems like a safe fix. Didn't test, just read it. |
|
@jordanstreiff Tested and could reproduce the bug in the simulator (iPhone 17, iOS 26.3). Trouble is that I could not reproduce the fix: the app freezes. The log in XCode shows right before the freeze:
Then after a while:
Then when I try clicking on something:
However,
|
|
Interesting. Thanks for sharing the logs etc. Curious why it worked for me. I'll take another look. |
Implemented a solution to address a known bug in WKWebView where gesture recognizers can become stuck after dismissing a remote-scene-hosted UI. When application becomes active we check to see if there are any stuck gesture recognizers and reset them.
Fix works when tested locally.
Closes #1147