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] The click event is not pressed on iOS 18.2. #2480

Closed
2 tasks done
ttb-inc opened this issue Dec 27, 2024 · 4 comments
Closed
2 tasks done

[iOS] The click event is not pressed on iOS 18.2. #2480

ttb-inc opened this issue Dec 27, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@ttb-inc
Copy link

ttb-inc commented Dec 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

After the event of the flutter Button UI is pressed, the event of the webview is not pressed.

The error occurs only on iOS 18.2.
Works fine on iOS 18.1.1 and earlier.

If I'm doing something wrong or need additional options, please help.
Thanks a lot.

Expected Behavior

Normal behavior.

Steps with code example to reproduce

Steps with code example to reproduce
  1. Try pressing the button in the webview (checks OK)
  2. Try pressing the FloatingActionButton '+' (UI event)
  3. Try pressing the button in the webview again (to check for errors).
  4. After pressing the 'Reload' button, reload the webview.
  5. Try pressing the button in the webview (checks OK)
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  late InAppWebViewController _webviewController;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
        leading: FloatingActionButton(
          onPressed: () {
            ///
            /// After reloading, the webview's events(e.g. onclick) will work again.
            ///
            _webviewController.reload();
          },
          child: const Icon(Icons.refresh),
        ),
      ),
      body: InAppWebView(
        initialUrlRequest: URLRequest(
          url: WebUri('https://google.com/'),
        ),
        onWebViewCreated: (controller) {
          _webviewController = controller;
        },
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          ///
          /// When a button input event is pressed, the webview's events(e.g. onclick) will stop working.
          ///
        },
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Stacktrace/Logs

...

Flutter version

Flutter 3.24.5

Operating System, Device-specific and/or Tool

iOS 18.2

Plugin version

v6.1.5

Additional information

The error occurs only on iOS 18.2.
Works fine on iOS 18.1.1 and earlier.

Self grab

  • I'm ready to work on this issue!
@ttb-inc ttb-inc added the bug Something isn't working label Dec 27, 2024
@ttb-inc
Copy link
Author

ttb-inc commented Dec 27, 2024

I'm using several flutter UIs on webview.
I'm experiencing a lot of issues.
I don't know if this is an iOS 18.2 issue, flutter SDK issue, or inappwebview package issue.
Thank you.

@ttb-inc
Copy link
Author

ttb-inc commented Dec 27, 2024

If you can review that the error is not related to the inappwebview package, I will repost it to the flutter forum.
Thank you.

@ttb-inc
Copy link
Author

ttb-inc commented Dec 27, 2024

webview_flutter: 4.10.0

I've checked the webview_flutter package and found the same error.
I will post the same on flutter forum.
Thank you.

@pichillilorenzo
Copy link
Owner

Please, do not post duplicate issues.
This is already resolved here: #2415

I pinned that issue to be more visible to everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants