Fix test util to measure text properly based on flex direction
Summary: Depending on the flex direction text will either be capped to the measured size or to the longest word, so I added that functionality Differential Revision: D67106199
This commit is contained in:
committed by
Facebook GitHub Bot
parent
13f4adbbcd
commit
7ef49a9abe
@@ -429,9 +429,11 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, {
|
||||
},
|
||||
|
||||
YGNodeSetMeasureFunc: {
|
||||
value: function (nodeName, innerText) {
|
||||
value: function (nodeName, innerText, flexDirection) {
|
||||
this.push(
|
||||
`${nodeName}.setMeasureFunc(instrinsicSizeMeasureFunc.bind("${innerText}"));`,
|
||||
`${nodeName}.setMeasureFunc(instrinsicSizeMeasureFunc.bind({text: "${innerText}", flexDirection: ${toValueJavascript(
|
||||
flexDirection,
|
||||
)}}));`,
|
||||
);
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user