This is problem In smaller device in Android i.e. Google pixel 2xl or 2a and not problem in larger device. Could somebody tell what is wrong?
Try add this to your props, worked for me.
customWrapper: (content) => {
return <Text textBreakStrategy="simple">{content}</Text>;
},
Try add this to your props, worked for me.
customWrapper: (content) => { return <Text textBreakStrategy="simple">{content}</Text>; },
hi,
can you give me full sample?
Try add this to your props, worked for me.
customWrapper: (content) => { return <Text textBreakStrategy="simple">{content}</Text>; },
I tried, it cut off more content. lol

@kamalpandey @ohitslaurence do you guys have any solution on this?
I tried
customWrapper={(content) => {return <TextInput multiline={true} editable={false} selectTextOnFocus={false}>{content}</TextInput>;}}
An error show out.
Invariant Violation: Nesting of <View> within <Text> is not currently supported
@nolife08021 No Waiting for some one to reply on this.
@kamalpandey
try this
<HTML
tagsStyles={{p:{ flex:1 }}}
allowFontScaling={false}
customWrapper={(content) => {return <TextInput style={{backgroundColor:'white'}} multiline={true} editable={false} selectTextOnFocus={false}>{content}</TextInput>;}}
baseFontStyle={{flex:1, fontSize:14, fontFamily: "System"}} ignoredStyles={["font-family"]}
html={html}/>
@kamalpandey Also try adding lineHeight to your html tags. Like 1.4x your font size
@kamalpandey Also try adding
lineHeightto your html tags. Like 1.4x your font size
lineHieght works for me. Thanks
@nolife08021 @ohitslaurence
I am using like this
<HTML
html={postBody}
onLinkPress={handleLinkPress}
imagesMaxWidth={imagesMaxWidth()}
ignoredStyles={[...IGNORED_STYLES]}
baseFontStyle={baseFontStyle()}
alterChildren={node => alterChildren(node)}
alterNode={node => alterNode(node)}
staticContentMaxWidth={staticContentMaxWidth()}
/>
where should i be using?
@nolife08021 @ohitslaurence
I am using like this
<HTML html={postBody} onLinkPress={handleLinkPress} imagesMaxWidth={imagesMaxWidth()} ignoredStyles={[...IGNORED_STYLES]} baseFontStyle={baseFontStyle()} alterChildren={node => alterChildren(node)} alterNode={node => alterNode(node)} staticContentMaxWidth={staticContentMaxWidth()} />
where should i be using?
@kamalpandey You can put the lineHeight inside your baseFontStyle


@ohitslaurence
I added this
const MOBILE_FONT_SIZE = 15;
export const baseFontStyle = () => {
return {
fontSize: isTablet ? TABLET_FONT_SIZE : MOBILE_FONT_SIZE,
lineHeight: MOBILE_FONT_SIZE * 1.4,
color: Colors.darker
};
};
but still issue persists.
@kamalpandey
I set the lineHeight in tagStyle.
<HTML
allowFontScaling={false}
tagsStyles={{p:{fontSize:18, padding:10, minHeight:60, lineHeight:22 }}}
baseFontStyle={{fontSize:scaledSize(18), fontFamily: "System", justifyContent:'center' }} ignoredStyles={["font-family"]}
html={JSON.parse(optionText)} {...htmlConfig}/>
Facing same issues on MIUI and oneplus OS.
Any updates?
@Tyki
For now you can use
this pr
Until this pr get merged
So this bug has reportedly appeared with React Native on Android Q (https://github.com/facebook/react-native/issues/25258). Since v5 release, you can use defaultTextProps and set textBreakStrategy to highQualitysimple in order to circumvent this bug. I'm closing this thread now as there is an easy workaround and the bug is upstream.
So this bug has reportedly appeared with React Native on Android Q (facebook/react-native#25258). Since v5 release, you can use
defaultTextPropsand settextBreakStrategytohighQualityin order to circumvent this bug. I'm closing this thread now as there is an easy workaround and the bug is upstream.
defaultTextProps={{ textBreakStrategy: 'highQuality' }}
not worked for me, set to simple not worked too.
sorry, mine was v4 so i need to update to v5.
now it works, but i had to set to simple, not highQuality
defaultTextProps={{ textBreakStrategy: 'simple' }}
oh dont forget after update version we have to reset Metro bundler cache, i found here https://github.com/meliorence/react-native-render-html/issues/375#issuecomment-643134215
Most helpful comment
@kamalpandey Also try adding
lineHeightto your html tags. Like 1.4x your font size