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_flutter] Webview response to Tap from the widget above it as Long press #81367
Comments
can you please provide the code of this page? |
Hi @yiv |
flutter doctor -v[✓] Flutter (Channel stable, 2.0.5, on macOS 11.2.3 20D91 darwin-x64, locale zh-Hans-CN)
• Flutter version 2.0.5 at /Volumes/data/project/sdks/flutter
• Framework revision adc687823a (12 days ago), 2021-04-16 09:40:20 -0700
• Engine revision b09f014e96
• Dart version 2.12.3
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Volumes/data/project/sdks/android
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Volumes/data/project/sdks/android
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 52.0.5
• Dart plugin version 203.5981.152
[✓] Connected device (3 available)
• YPhone (mobile) • 00008030-000515EE1A32802E • ios • iOS 14.4
• iPhone 12 Pro (mobile) • 0FC5DC9C-66EE-4338-BEF1-9C7BDE8E5CE8 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.93
• No issues found! |
Hi @yiv |
https://github.com/yiv/flutter_demo I have clean the code, removed some unrelated code and UI.
Steps to reproduce:
|
@yiv Screen.Recording.2021-04-30.at.10.05.44.AM.mov |
@TahaTesser There are some logic bugs, try hot reload the flutter app then the item will shows up |
@yiv Screen.Recording.2021-04-30.at.11.00.22.AM.mov |
Yes, it close the drawer after tap the item. Then the menu of web app shows up like the video |
Hi @yiv flutter doctor -v[✓] Flutter (Channel stable, 2.0.6, on macOS 11.3 20E232 darwin-x64, locale en-GB)
• Flutter version 2.0.6 at /Users/tahatesser/Code/flutter_stable
• Framework revision 1d9032c7e1 (3 days ago), 2021-04-29 17:37:58 -0700
• Engine revision 05e680e202
• Dart version 2.12.3
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Volumes/Extreme/SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = /Volumes/Extreme/SDK
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS
• Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
• Xcode 12.5, Build version 12E262
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.55.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.21.0
[✓] Connected device (3 available)
• Taha’s iPad (mobile) • 00008020-000255113EE8402E • ios • iOS 14.5
• iPhone 12 (mobile) • 4D5BE4C8-BF1D-46CD-B595-FD81A7140B52 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-5
(simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.93
! Error: Taha’s iPad is busy: Copying cache files from device. Xcode will continue when Taha’s iPad is finished. (code -10)
! Doctor found issues in 1 category. [✓] Flutter (Channel master, 2.3.0-1.0.pre.205, on macOS 11.3 20E232 darwin-x64, locale en-GB)
• Flutter version 2.3.0-1.0.pre.205 at /Users/tahatesser/Code/flutter_master
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 96e4b47f5d (18 hours ago), 2021-05-02 07:24:01 -0700
• Engine revision 3e578c6e0d
• Dart version 2.14.0 (build 2.14.0-48.0.dev)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Volumes/Extreme/SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = /Volumes/Extreme/SDK
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS
• Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
• Xcode 12.5, Build version 12E262
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] IntelliJ IDEA Community Edition (version 2021.1.1)
• IntelliJ at /Volumes/Extreme/IntelliJ IDEA CE.app
• Flutter plugin version 55.1.5
• Dart plugin version 211.7233
[✓] VS Code (version 1.55.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.21.0
[✓] Connected device (3 available)
• Taha’s iPad (mobile) • 00008020-000255113EE8402E • ios • iOS 14.5
• iPhone 12 (mobile) • 4D5BE4C8-BF1D-46CD-B595-FD81A7140B52 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-5
(simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.93
! Error: Taha’s iPad is busy: Copying cache files from device. Xcode will continue when Taha’s iPad is finished. (code -10)
! Doctor found issues in 1 category. |
@TahaTesser, @yiv: I just want to add my two cents on this issue. I have a similar issue with my web application based on Autodesk Forge Viewer. I found out that tapping on a Flutter widget located on top of the WebView (in iOS only) results in a "touchstart" event being propagated to the WebView (which actually should not happen because I would expect the button widget to "consume" the tap event entirely), but no "touchend" event at all! When I tap the widget again, the missing "touchend" is fired first, then immediately followed by a fresh "touchstart" (with the corresponding "touchend" event missing again). I don't know how the web application's longpress has been implemented. But usually those web applications use the "touchstart" event to start a timer, which gets stopped, if a "touchend" is received. If the timer expires before this happens, it considers the user's gesture being a "longpress" and act accordingly. As the "touchend" never is fired within the longpress time interval, the timer expires and the web application detects a "longpress". I have opened an issue (#91681) in a similar case that demonstrates, which touch events are detected by the webview. I also included a video that shows the touch event behavior explained above. In my case it was an active IgnorePointer widget wrapped around a webview. But I had exactly the same issue, when tapping on Flutter widget on top of a webview. So I assume there might be some relationship. |
@TahaTesser, @yiv: I just took the time to adjust my code sample from #91681 to make minimal showcase that demonstrates the behavior I attempted to point out in my last comment and which closely relates to the original issue in this ticket. Please find attached the complete Flutter application code for reproduction and also a small screen recording. The recording shows a WebView on which a FloatingActionButton has been placed. The web application in the webview logs any touchstart, touchend, click and longpress events (the latter which has been implemented by the mechanism explained in my previous comment) as they are received and handled by the webview. The first two clicks are performed directly on the webview and work flawlessly. The next couple of clicks are performed on the FloatingActionButton, and you can easily see the different handling of touch events handled by the web application, which eventually results in incorrect detection of "longpress" events (as explained in my previous comment). I think this is the reason why the web application posted by @yiv detects longpress events when tapping on the Flutter widget. Full Flutter Code for reproduction ScreenFlow.mp4flutter doctor -v
|
Not only Long press but also simply tap also
|
OK!
|
I layout a stack on a screen, on the bottom of the stack there is a Webview, and above the Webview there are multiple Buttons.
When I tap the button, the Long Press menu on the Webview shows up.
And I also have a Drawer, when I tap the item on the Drawer, the Drawer faded out, and the Long Press menu on the Webview shows up too.
The text was updated successfully, but these errors were encountered: