-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
WebView touchstart events are invoked even when the WebView is not hit tested on iOS #30143
Comments
cc @cyanglaz |
Spent some time investigate this issue with @amirh and @chinmaygarde debugging this issue. We tried replacing 'touchstart' with a different event like 'click', it works fine. We think there could be some special case handling for events like 'touchstart' in iOS. We have not found any way to work around it. Meanwhile, if anyone encounter this issue, I suggest working around it with a different event type on the web application. |
In my case, it even worse. When I tap a block in front of WebView, WebView receives touchstart, but does not receive touchend. And it will receive touchend on the next tap with new touchstart right after it.
This behavior breaks my Leaflet map completely. It behaves like always touched.
Adding IgnorePointer/AbsorbPointer does not help here. Somehow the page inside WebView still receives touchstart/touchend. I think other issues about broken map controls could probably have the same source of a problem. Both of WebView/iOS/touch-related proposed fixes at and https://gist.github.com/Voxar/5dbef0b76cc8cb55d2fe74a492d41c54 does not work for me. I'm testing on iOS 13.6. |
A little clarification. As for Leaflet, it actually does not use these touch events on iOS by default. Leaflet detects support for pointer events and uses them instead of touchstart/touchend. And glitches occur because of this: if WebView is touched directly it does receive pointerup and pointerdown. But if a block in front of WebView is touched, pointerdown event is leaking to DOM event listener, but somehow pointerup event does not occur leaving pointerdown alone in the Leaflet's internal array of pointer events. For my project I fixed that by overriding pointer detection @ https://github.com/Leaflet/Leaflet/blob/9b0d7c2a7023e6a83222d96febaee74880601ad8/src/core/Browser.js#L96 setting it to false. Leaflet fallbacks to touchstart/touchend and even though it does receive events from other blocks when it shouldn't because of this bug, it maintains internal state correctly. |
The issue is reproducible on the latest flutter doctor -v
|
We are facing the exactly same issue as @asavartsov described in iOS 15.4 and flutter 2.10.3 when using |
Thanks @asavartsov for the description and your workaround. I can't seem to do the same workaround since I'm using a third party library in the webview - I tried catching/disabling touchstart events and creating fake touchend events, but couldn't get it to work with the library. My options left are (1) don't put buttons on top of the webview (below/beside instead), or (2) put the buttons inside the webview instead of being implemented in flutter (and have the html buttons trigger events that get noticed in flutter - which in flutter Web I needed this hack) |
I spent couple of days to solve this problem. I wrote code like this Stack(children: [ This works fine so far. |
@kcisoul Thanks for providing the workaround. To make the workaround easier, I think you only need to create an empty transparent PlatformView (UIView) to cover the region that you don't want the WebView to be interacted with. |
@kcisoul |
@krokyze yep! thats the plan |
Update: Plan to merge next week post holiday weekend |
Addresses flutter/flutter#30143 by adding an iOS implementation This PR is Part 1 of #5233
Reverts #5499 Initiated by: stuartmorgan This change reverts the following previous change: Original Description: Addresses flutter/flutter#30143 by adding an iOS implementation This PR is Part 1 of #5233
Addresses flutter/flutter#30143 by adding an iOS implementation This PR is Part 1 of #5233 This reverts commit bc72d15 and then fixes the topic format
…ion to federated structure (#5500) Addresses flutter/flutter#30143 by adding an iOS implementation This PR is Part 2 of #5233
…plementation to federated structure" (#5591) Reverts #5500 Initiated by: stuartmorgan This change reverts the following previous change: Original Description: Addresses flutter/flutter#30143 by adding an iOS implementation This PR is Part 2 of #5233
This is essentially the same PR as #5500, with pubspec updates Addresses flutter/flutter#30143 by adding an iOS implementation This PR is Part 2 of #5233
Addresses flutter/flutter#30143 by adding an iOS implementation, and flutter/flutter#138217 by fixing README links This PR is Part 3/3 of #5233
The new pointer_interceptor package should be available on pub.dev. now! https://pub.dev/packages/pointer_interceptor |
Addresses flutter/flutter#30143 by adding an iOS implementation This PR is Part 1 of flutter#5233
Reverts flutter#5499 Initiated by: stuartmorgan This change reverts the following previous change: Original Description: Addresses flutter/flutter#30143 by adding an iOS implementation This PR is Part 1 of flutter#5233
Addresses flutter/flutter#30143 by adding an iOS implementation This PR is Part 1 of flutter#5233 This reverts commit bc72d15 and then fixes the topic format
…ion to federated structure (flutter#5500) Addresses flutter/flutter#30143 by adding an iOS implementation This PR is Part 2 of flutter#5233
…plementation to federated structure" (flutter#5591) Reverts flutter#5500 Initiated by: stuartmorgan This change reverts the following previous change: Original Description: Addresses flutter/flutter#30143 by adding an iOS implementation This PR is Part 2 of flutter#5233
This is essentially the same PR as flutter#5500, with pubspec updates Addresses flutter/flutter#30143 by adding an iOS implementation This PR is Part 2 of flutter#5233
…ter#5640) Addresses flutter/flutter#30143 by adding an iOS implementation, and flutter/flutter#138217 by fixing README links This PR is Part 3/3 of flutter#5233
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Internal: b/126614142
Internal: b/285315999
Sample repro app:
On iOS the message is printing even when tapping the FAB.
The text was updated successfully, but these errors were encountered: