Skip to content

Commit e0cd671

Browse files
committed
Fix maxWidth not working for flex when parent is unmeasurable
1 parent f405d7e commit e0cd671

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changeset/puny-hoops-rush.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@plexinc/react-lightning-plugin-flexbox": patch
3+
---
4+
5+
Fix maxWidth when parent is unmeasurable

packages/plugin-flexbox/src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ export function plugin(yogaOptions?: YogaOptions): Plugin<LightningElement> {
250250
computedWidth = isPercentage
251251
? parentWidth * (maxWidth.value / 100)
252252
: parentWidth;
253+
} else if (maxWidth.unit === Yoga.instance.UNIT_POINT) {
254+
computedWidth = maxWidth.value;
253255
}
254256
}
255257

0 commit comments

Comments
 (0)