Skip to content

Commit

Permalink
Fix maxWidth not working for flex when parent is unmeasurable
Browse files Browse the repository at this point in the history
  • Loading branch information
WillsonHaw committed Feb 26, 2025
1 parent f405d7e commit e0cd671
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/puny-hoops-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@plexinc/react-lightning-plugin-flexbox": patch
---

Fix maxWidth when parent is unmeasurable
2 changes: 2 additions & 0 deletions packages/plugin-flexbox/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ export function plugin(yogaOptions?: YogaOptions): Plugin<LightningElement> {
computedWidth = isPercentage
? parentWidth * (maxWidth.value / 100)
: parentWidth;
} else if (maxWidth.unit === Yoga.instance.UNIT_POINT) {
computedWidth = maxWidth.value;
}
}

Expand Down

0 comments on commit e0cd671

Please sign in to comment.