Skip to content

Commit 3e7d502

Browse files
authored
[pointer_interceptor] fix width and height unset warning on web platform (#5864)
This PR adds width/height to the dom element created by the default factory to prevent the framework from screaming at usages of this plugin. Needed until this bit becomes `stable`: * https://github.com/flutter/engine/blob/3106e08e12198d98b75c459ac3290f4101b68574/lib/web_ui/lib/src/engine/platform_views/content_manager.dart#L229-L238 ## Issues * Fixes flutter/flutter#141323 - [] I updated/added relevant documentation (doc comments with `///`).
1 parent 39ffed3 commit 3e7d502

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.10.1+2
2+
3+
* Fixes "width and height missing" warning on web.
4+
15
## 0.10.1+1
26

37
* Updates minimum required plugin_platform_interface version to 2.1.7.

packages/pointer_interceptor/pointer_interceptor_web/lib/pointer_interceptor_web.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ class PointerInterceptorWeb extends PointerInterceptorPlatform {
1818

1919
// Slightly modify the created `element` (for `debug` mode).
2020
void _onElementCreated(Object element) {
21-
(element as web.HTMLElement).style.backgroundColor = 'rgba(255, 0, 0, .5)';
21+
(element as web.HTMLElement)
22+
..style.width = '100%'
23+
..style.height = '100%'
24+
..style.backgroundColor = 'rgba(255, 0, 0, .5)';
2225
}
2326

2427
@override

packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pointer_interceptor_web
22
description: Web implementation of the pointer_interceptor plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor/pointer_interceptor_web
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3Apointer_interceptor
5-
version: 0.10.1+1
5+
version: 0.10.1+2
66

77
environment:
88
sdk: ^3.2.0

0 commit comments

Comments
 (0)