-
Notifications
You must be signed in to change notification settings - Fork 25k
Closed
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
Description
onLayout and .measure doesn't work for nested Text components
Reproduction
Link to demo: https://rnplay.org/apps/rSlYMg
Let's say we have next layout
<View>
<Text onLayout={this.onRootTextLayout}>
<Text onLayout={this.onChildTextLayout}>Text</Text>
</Text>
</View>onLayout for the first (outer) Text works as expected. But it doesn't work for the second (nested) component.
The same for the .measure method.
<View>
<Text ref={el => this.rootText = el}>
<Text ref={el => this.childText = el}>Text</Text>
</Text>
</View>
// ...
// Works as expected
this.rootText.measure((fx, fy, width, height, px , py) => console.log('rootText offset top:' + py));
// Doesn't work. Always show 0.
this.childText.measure((fx, fy, width, height, px, py) => console.log('childText offset top:' + py));Additional Information
- React Native version: 0.38
- Platform: both
- Operating System: MacOS
ilyaivanov, maslianok, ababich, Kendjiya, nhobi and 7 morederekleee and ramonsenadev
Metadata
Metadata
Assignees
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.