Skip to content
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

ios when did horizontal scrolling, webview has not response anymore #376

Closed
whatamelon opened this issue Jun 3, 2020 · 10 comments
Closed
Labels

Comments

@whatamelon
Copy link

whatamelon commented Jun 3, 2020

Environment

Flutter version: 1.17
Plugin version: 3.2.0
Android version: android 8
iOS version: 13.5
Xcode version: latest
Device information: iphone 11

I just scroll few times, and after I touched and scrolled webview did not behave as I expect.
It's only ios problem. Android going well.

Have anyone know how to solve this issue?

Images

video link
https://drive.google.com/file/d/1RoD7Ttqr80h6ibGn7z2cd2DweZwJZBg6/view?usp=sharing

@whatamelon whatamelon changed the title ios when did horizontal scrolling, webview can' ios when did horizontal scrolling, webview has not response anymore Jun 3, 2020
@whatamelon
Copy link
Author

I've changed version 3.2.0 -> 3.3.0+3.
It still not work

@pichillilorenzo
Copy link
Owner

I can't reproduce the error. Horizontal scrolling is working fine on iOS

@whatamelon
Copy link
Author

hi @pichillilorenzo Actually that means horizontal swipe. Apology for my lack description.
As you can see the video, I just scroll vertically and swipe html carousel few times.
And then, the webview gonna stop.
For more, in debug with xcode, if i touch or swipe then touch response return to my terminal.
But, the webview gonna stop,any response return anymore with touch.

I always have thankful for your library.
Thankyou XD

@pichillilorenzo
Copy link
Owner

I don't have access to your video. Could you make it public?

Could you post here the code that is not working??
Also, did you test it in a real device? Or just on the emulator?

@whatamelon
Copy link
Author

Hi, @pichillilorenzo. Sorry for the video.
Well, I'm testing with real device. And also update video publical.

This is my code.

InAppWebView(
key: _shopKey,
initialUrl: Uri.encodeFull(widget.viewData[0]),
initialHeaders: {},

                  initialOptions: InAppWebViewGroupOptions(
                    crossPlatform: InAppWebViewOptions(
                        javaScriptEnabled: true,
                        debuggingEnabled: true,
                    ),
                    ios: IOSInAppWebViewOptions(
                      allowsBackForwardNavigationGestures: false,
                    )
                  ),
                  onWebViewCreated: (InAppWebViewController webViewController) async{
                    Timer(Duration(seconds: 2), () async{
                        setState(() {
                          _isConnect = true;
                          _urlChange = true;
                        });
                      });
                    print("start  :   ${widget.viewData[0]}");
                    _ShopViewController = webViewController;
                  },
                  onLoadStart: (InAppWebViewController controller, String url) async{
                    print('Page started loading: $url');
                  },
                  onLoadStop: (InAppWebViewController controller, String url) async {
                    print('Page stop loading: $url');
                    if(!_isFirst) {
                      widget.viewData[0] = url;
                      print(widget.viewData[0]);
                      setState(() {
                        _isFirst = true;
                      });
                    }
                  },
                  onUpdateVisitedHistory: (InAppWebViewController controller, String url, bool androidIsReload) async{
                    print("onUpdateVisitedHistory $url");
                    print('이건 widgetdata : ${widget.viewData[0]}');
                    if(_isFirst) {
                      if(widget.viewData[0] != url) {
                        print('url different');
                        setState(() {
                          _urlChange = false;
                        });
                      } else {
                        print('url same');
                        setState(() {
                          _urlChange = true;
                        });
                      }
                      print(_urlChange);
                    }
                  },
                ),

this is inappwebview 3.4.0

If I upgrade version, this issue can not make anymore?

Thanks for your package. XD

This was referenced Jul 6, 2020
@emran92
Copy link

emran92 commented Jul 14, 2020

hi @pichillilorenzo Thanks for the great package! Really loving all the extra options than other webview packages. However, I'm having similar issue here.
I'm on

flutter_inappwebview: ^4.0.0+4

Flutter Doctor

[✓] Flutter (Channel master, 1.20.0-0.0.pre, on Mac OS X 10.15.5 19F101, locale en-BD)
    • Flutter version 1.20.0-0.0.pre at /users/emran/Development/flutter
    • Framework revision d9653445f4 (5 weeks ago), 2020-06-09 18:43:03 -0400
    • Engine revision e8c13aa012
    • Dart version 2.9.0 (build 2.9.0-14.0.dev 5c1376615e)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/emran/Library/Android/sdk
    • Platform android-30, build-tools 29.0.3
    • ANDROID_HOME = /Users/emran/Library/Android/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-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.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 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.46.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.11.0

 
[✓] Connected device (4 available)            
    • iPhone     • 868489061a69866195f81a8dbe9396a77addd056 • ios            • iOS 13.5.1
    • macOS      • macOS                                    • darwin-x64     • Mac OS X 10.15.5 19F101
    • Web Server • web-server                               • web-javascript • Flutter Tools
    • Chrome     • chrome                                   • web-javascript • Google Chrome 83.0.4103.116

Video:

https://drive.google.com/file/d/1c8o8EMRpm9vdigamCGYZLlY0kN3WwEmp/view?usp=sharing

Check the video, the scroll gestures stops working after some horizontal scroll. The WebView isn't responding anymore. Not that it happens always but when it does, it gets stuck and nothing can be done on the webview.

It's happening on real device. Please run the code below and scroll like the video. Thanks!

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';

Future main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
  InAppWebViewController _webViewController;

  AnimationController _controller;
  Animation<double> animation;
  bool isLoading = true;

  int _loadProgress = 0;

  bool get finished => _loadProgress == 100;

  @override
  void initState() {
    _controller = AnimationController(
      vsync: this,
      duration: const Duration(
        milliseconds: 3000,
      ),
    )..forward();

    animation = Tween<double>(
      begin: 0,
      end: 1.0,
    ).animate(CurvedAnimation(parent: _controller, curve: Curves.easeIn))
      ..addListener(() {
        setState(() {});
      });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: SafeArea(
        child: Scaffold(
          body: Container(
              child: Column(children: <Widget>[
            finished == false
                ? Container(
                    width: double.infinity,
                    height: 3,
                    child: LinearProgressIndicator(
                      value: animation.value,
                      semanticsLabel: _loadProgress.toString(),
                      semanticsValue: _loadProgress.toString(),
                      valueColor: AlwaysStoppedAnimation(Color(0xff952729)),
                      backgroundColor: Colors.black,
                    ),
                  )
                : Container(color: Colors.transparent),
            Expanded(
                child: InAppWebView(
              initialUrl: "https://www.killerinktattoo.co.uk/",
              initialOptions: InAppWebViewGroupOptions(
                crossPlatform: InAppWebViewOptions(
                  debuggingEnabled: true,
                ),
              ),
              onWebViewCreated: (InAppWebViewController controller) {
                _webViewController = controller;
              },
              onProgressChanged:
                  (InAppWebViewController controller, int progress) {
                _webViewController = controller;
                this._loadProgress = progress;
                if (this._loadProgress == 100) {
                  _controller.reset();
                } else {
                  _controller.forward();
                }
              },
            ))
          ])),
        ),
      ),
    );
  }
}

I've checked some other jQuery slider links too. Same happens there also

initialUrl: "https://bxslider.com",
initialUrl: "https://kenwheeler.github.io/slick/",

@deicon
Copy link

deicon commented Jul 17, 2020

Same issue here using 4.0.0+4
The loaded page contains Javascript and behaves fine. But after a few interactions, no more gestures are detected. The other widgets on the screen do still receive Gestures, but the actual webview seems stuck.

This happens on both ios and android physical phones.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.20.0-7.0.pre, on Mac OS X 10.15.5 19F101, locale en-GB)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.1.2)
[✓] VS Code (version 1.47.2)
[✓] Connected device (4 available)

@whatamelon
Copy link
Author

whatamelon commented Nov 24, 2020

I think this can happen easily when use web video player.
And I think this problem can't solve nowadays flutter's state.
If you guy's have any plan for solve this than I can close this issue.

Copy link

github-actions bot commented Oct 7, 2024

This issue is stale and has been automatically closed because it has been open for more than 365 days with no activity. Please reopen a new issue if you still have it.

@github-actions github-actions bot added the stale label Oct 7, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
Copy link

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 and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants