-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text renderRule is not accepting textBreakStrategy prop #52
Comments
Yes, It seems even "numberOfLines" prop is not respected right now. |
So, apparently, the prop does apply to the |
A couple of things here - the horrible textgroup / text hierarchy is explained here: #42 (comment) Its a pain.... but I don't know another way of doing it. @jayshah123 as a consequence of having to nest the text elements - this bug: facebook/react-native#22811 is causing the numberOfLines prop to not work @abelyeupear i am struggling to replicate the underlying issue on an emulator set to API 29 // Android 10 - what specifically is happening? can you provide me a sample / screenshots? :) |
Closing because i am not sure what next steps are without some help from @abelyeupear - feel free to reopen |
Sorry, busy week! The steps to reproduce are mainly: Android 10 (emulator or not), |
I will reopen because it seems that the default textgroup rule should maybe have the breackStrat added as you say, Will do some more testing over the next couple of days and see! |
I use this rule as a workaround for const rules: RenderRules = {
...YourRules,
textgroup: node => {
return (
<Text
key={node.key}
numberOfLines={3}
>
{node.children?.[0].content}
</Text>
);
},
}; |
Since Android 10,
textBreakStrategy="simple"
is necessary for the text not to break in a way that can hide the last word of the text. Apparently, only the prop mentioned above solves this issue.I tried adding this prop to the
text
renderRule like:But the prop is not being applied appropriately, or, at least, the text is still breaking. I have two questions:
textBreakStrategy="simple"
is applied?The text was updated successfully, but these errors were encountered: