File tree 2 files changed +6
-7
lines changed
packages/plugin-flexbox/src
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 1
1
import type {
2
2
LightningElement ,
3
3
LightningElementStyle ,
4
- LightningTextElement ,
5
4
LightningViewElementStyle ,
6
5
Plugin ,
7
6
} from '@plexinc/react-lightning' ;
@@ -259,6 +258,7 @@ export function plugin(yogaOptions?: YogaOptions): Plugin<LightningElement> {
259
258
computedWidth > 0 &&
260
259
event . dimensions . width > computedWidth
261
260
) {
261
+ node . contain = 'width' ;
262
262
node . width = computedWidth ;
263
263
}
264
264
}
@@ -283,12 +283,6 @@ export function plugin(yogaOptions?: YogaOptions): Plugin<LightningElement> {
283
283
return props ;
284
284
}
285
285
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
-
292
286
for ( const key in remainingStyles ) {
293
287
const value = remainingStyles [ key as keyof LightningViewElementStyle ] ;
294
288
You can’t perform that action at this time.
0 commit comments