Skip to content

[pointer_interceptor] on web prints Set style.width to any appropriate value to stop this message. #141323

@cedvdb

Description

@cedvdb

Steps to reproduce

Use pointer interceptor on the web

Expected results

no warning message

Actual results

Width of Platform View type: [_default_document_create_element_invisible] may not be set. Defaulting to width: 100%.
Set style.width to any appropriate value to stop this message.

Read more here: https://docs.flutter.dev/release/breaking-changes/platform-views-using-html-slots-web

Code sample

In pointer_interceptor implementation this;

  void _onElementCreated(Object element) {
    (element as web.HTMLElement).style.backgroundColor = 'rgba(255, 0, 0, .5)';
  }

Should be:

  void _onElementCreated(Object element) {
    (element as web.HTMLElement).style.width = '100%';
    (element as web.HTMLElement).style.height = '100%';
    (element as web.HTMLElement).style.backgroundColor = 'rgba(255, 0, 0, .5)';
  }

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

(dev): flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.16.5, on Microsoft Windows [Version 10.0.22621.3007], locale en-BE)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.32)
[√] Android Studio (version 2023.1)
[√] VS Code (version 1.85.1)
[√] Connected device (3 available)
[√] Network resources

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listfound in release: 3.16Found to occur in 3.16found in release: 3.19Found to occur in 3.19has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: pointer_interceptorA widget to prevent clicks from being swallowed by underlying HtmlElementViews on the webpackageflutter/packages repository. See also p: labels.platform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions