flutter_inappwebview
flutter_inappwebview copied to clipboard
[WebView-IOS] Touch delay 300ms.
Environment
**Flutter version: 3.0.5 Plugin version: flutter_inappwebview: ^5.4.3+7 **iOS version: deployment target 12 **Xcode version: 13.4.1 Device information: Any IOS devices
Description
**
- Currently I use flutter inappwebview on to my app. The problem is new touch is only recognize after 300ms (or 500ms , I guest). When touch fast it will not recognize. My website I embbed is work normally on android and browsser.**
**Is there a feature of IOS or anyway to config it on IOS?
👋 @manle93
NOTE: This comment is auto-generated.
Are you sure you have already searched for the same problem?
Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!
If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.
In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE]
or ios WKWebView [MY ERROR HERE]
keywords.
Following these steps can save you, me, and other people a lot of time, thanks!
I was try on native WKWebview and its work normally. TOuch was recognized!
Any suggestion for me? :( Really bad UX on IOS
Has anyone found a solution to this?
Think it's related to this: https://webkit.org/blog/5610/more-responsive-tapping-on-ios/ It seems like WebKit is happy to disable double-tap to zoom when those meta tags are set, and this is the case in stock Safari.
It doesn't behave in the same way in an InAppWebView, though. I've also tried setting supportZoom: false
but this hasn't made a difference. Is there a gesture handler I can set to work around this, perhaps?
+1. Not even meta width=device-width
nor touch-action: manipulation
works.
Is there any solution yet?
Has anyone made any progress on this?
After some digging, this seems to be caused by this issue. So, not even related to the "slow tap delay" from Safari WebKit at all, but caused by Flutter's handling of gestures between native/platform views and their own UI kit's views.
Didn't find a proper solution yet.
Edit: And just to be clear, this issue happens on all Flutter webview libraries (well, at least the ones that wrap a native WKWebView), including webview_flutter.
+1 такая же проблема!
@swordyy7 published a fix on https://github.com/pichillilorenzo/flutter_inappwebview/issues/216.
To anyone else who wants to try this fix, I just published a fork of flutter_inappwebview.
-
flutter pub remove flutter_inappwebview
-
flutter pub add flutter_inappwebview_fix_iostouchdelay
- Update your imports from
flutter_inappwebview
toflutter_inappwebview_fix_iostouchdelay
, example:- From:
import "package:flutter_inappwebview/flutter_inappwebview.dart";
- To:
import "package:flutter_inappwebview_fix_iostouchdelay/flutter_inappwebview_fix_iostouchdelay.dart";
- From:
The forked library is listed on pub.dev here, and the source code is here.
Hope this helps someone. :)
Adding the FlutterPlatformViewGestureRecognizersBlockingPolicyWaitUntilTouchesEnded
policy seems to fix this in a less hacky way, but it shares the same tradeoffs as the other solutions mentioned above, which is that gestures get passed through to the webview even if you put opaque widgets on top of the webview.
I've created a PR (#1665) which adds a flag preventGestureDelay
which is off by default, but you can optionally enable it to use a view with the "WaitUntilTouchesEnded" policy.
Hello there!
I am also facing the same issue. I have a page where I need to select multiple options one after the other. I can select options but can't select them fast.
I guess this is due to the touch response delay. If anyone can help me to solve this issue, it would be great.
Thanks