Skip to content

Commit

Permalink
Set IFRAME width & height to conform to platform view constraints (#1253
Browse files Browse the repository at this point in the history
  • Loading branch information
daohoangson authored May 18, 2024
1 parent fb7d6ea commit abd4b02
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/fwfh_webview/lib/src/web_view/js_interop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ class WebViewState extends State<WebView> {
_iframeElement.allow = 'autoplay';
}

// https://docs.flutter.dev/release/breaking-changes/platform-views-using-html-slots-web
_iframeElement.style
..height = '100%'
..width = '100%';

final viewType = '$this#$hashCode';

platformViewRegistry.registerViewFactory(viewType, (_) => _iframeElement);
Expand Down

1 comment on commit abd4b02

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.