File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
packages/plugin-flexbox/src Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @plexinc/react-lightning-plugin-flexbox " : patch
3+ ---
4+
5+ Fix bug with maxWidth not setting contain property on text nodes
Original file line number Diff line number Diff line change 11import type {
22 LightningElement ,
33 LightningElementStyle ,
4- LightningTextElement ,
54 LightningViewElementStyle ,
65 Plugin ,
76} from '@plexinc/react-lightning' ;
@@ -259,6 +258,7 @@ export function plugin(yogaOptions?: YogaOptions): Plugin<LightningElement> {
259258 computedWidth > 0 &&
260259 event . dimensions . width > computedWidth
261260 ) {
261+ node . contain = 'width' ;
262262 node . width = computedWidth ;
263263 }
264264 }
@@ -283,12 +283,6 @@ export function plugin(yogaOptions?: YogaOptions): Plugin<LightningElement> {
283283 return props ;
284284 }
285285
286- // purposely using a falsy check on maxWidth here, since we don't want the
287- // contain mode set to `width` if it's set to 0 or an empty string
288- if ( props . style ?. maxWidth && instance . node && instance . isTextElement ) {
289- ( instance as LightningTextElement ) . node . contain = 'width' ;
290- }
291-
292286 for ( const key in remainingStyles ) {
293287 const value = remainingStyles [ key as keyof LightningViewElementStyle ] ;
294288
You can’t perform that action at this time.
0 commit comments