-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressiona: platform-viewsEmbedding Android/iOS views in Flutter appsEmbedding Android/iOS views in Flutter appscustomer: money (g3)found in release: 2.2Found to occur in 2.2Found to occur in 2.2found in release: 2.5Found to occur in 2.5Found to occur in 2.5p: webviewThe WebView pluginThe WebView pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
Internal: b/126614142
Internal: b/285315999
Sample repro app:
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
void main() => runApp(MaterialApp(home: WebViewExample()));
class WebViewExample extends StatelessWidget {
final Completer<WebViewController> _controller =
Completer<WebViewController>();
@override
Widget build(BuildContext context) {
return Scaffold(
body: WebView(
initialUrl: 'https://master-docs-flutter-io.firebaseapp.com/',
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
_controller.complete(webViewController);
},
onPageFinished: (String url) {
injectTouchListener();
},
javascriptChannels: <JavascriptChannel> [
JavascriptChannel(name: 'Log', onMessageReceived: (JavascriptMessage msg) { print(msg.message); })
].toSet() ,
),
floatingActionButton: FloatingActionButton(
child: Container(color: Colors.orange,),
onPressed: () {}
),
);
}
Future<void> injectTouchListener() async {
final WebViewController controller = await _controller.future;
controller.evaluateJavascript("document.addEventListener('touchstart', (event) => { Log.postMessage(String(event)); }, true);");
}
}On iOS the message is printing even when tapping the FAB.
ggirotto, matuella, guzishiwo, Xardas365, VojtaMaiwald and 2 more
Metadata
Metadata
Assignees
Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressiona: platform-viewsEmbedding Android/iOS views in Flutter appsEmbedding Android/iOS views in Flutter appscustomer: money (g3)found in release: 2.2Found to occur in 2.2Found to occur in 2.2found in release: 2.5Found to occur in 2.5Found to occur in 2.5p: webviewThe WebView pluginThe WebView pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Type
Projects
Status
Engineer reviewed