Skip to content

Commit

Permalink
Only sync attributes into CSS width/height if an element has both.
Browse files Browse the repository at this point in the history
Related to #1169
  • Loading branch information
daohoangson committed May 8, 2024
1 parent a5d161e commit 9af26bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/core/lib/src/internal/ops/tag_img.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ class TagImg {
kCssMinWidth: '0px',
kCssMinHeight: '0px',
kCssWidth: kCssLengthAuto,
if (height != null) kCssHeight: '${height}px',
if (width != null) kCssWidth: '${width}px',
if (height != null && width != null) ...{
kCssHeight: '${height}px',
kCssWidth: '${width}px',
},
};
}

Expand Down
6 changes: 4 additions & 2 deletions packages/fwfh_webview/lib/src/web_view_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ mixin WebViewFactory on WidgetFactory {
'min-width': '0px',
'min-height': '0px',
'width': 'auto',
if (height != null) 'height': '${height}px',
if (width != null) 'width': '${width}px',
if (height != null && width != null) ...{
'height': '${height}px',
'width': '${width}px',
},
};
},
onWidgets: (meta, widgets) {
Expand Down

0 comments on commit 9af26bd

Please sign in to comment.