flutter_inappwebview icon indicating copy to clipboard operation
flutter_inappwebview copied to clipboard

[WebView-IOS] Touch delay 300ms.

Open manle93 opened this issue 1 year ago • 3 comments

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 avatar Aug 01 '22 09:08 manle93

👋 @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!

github-actions[bot] avatar Aug 01 '22 09:08 github-actions[bot]

I was try on native WKWebview and its work normally. TOuch was recognized!

manle93 avatar Aug 01 '22 10:08 manle93

Any suggestion for me? :( Really bad UX on IOS

manle93 avatar Aug 05 '22 06:08 manle93

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?

harryhjsh avatar Nov 21 '22 17:11 harryhjsh

+1. Not even meta width=device-width nor touch-action: manipulation works.

JoaaoVerona avatar Dec 21 '22 09:12 JoaaoVerona

Is there any solution yet?

SangHunShin avatar Dec 22 '22 00:12 SangHunShin

Has anyone made any progress on this?

harryhjsh avatar Jan 20 '23 13:01 harryhjsh

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.

JoaaoVerona avatar Feb 04 '23 23:02 JoaaoVerona

+1 такая же проблема!

matovnikov avatar Mar 14 '23 20:03 matovnikov

@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 to flutter_inappwebview_fix_iostouchdelay, example:
    • From: import "package:flutter_inappwebview/flutter_inappwebview.dart";
    • To: import "package:flutter_inappwebview_fix_iostouchdelay/flutter_inappwebview_fix_iostouchdelay.dart";

The forked library is listed on pub.dev here, and the source code is here.

Hope this helps someone. :)

JoaaoVerona avatar Mar 15 '23 19:03 JoaaoVerona

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.

andreasgangso avatar May 23 '23 15:05 andreasgangso

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

deekshithdv avatar Jul 24 '23 02:07 deekshithdv