-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Issue with allowFontScaling option interfering with lineHeight #23
Comments
It could be a possible bug in react native that causes the lineHeight to still be adjusted. See: facebook/react-native#2783 |
I'll await responses to the bugreport. IIRC |
I had to comment: Without that the icons are truncated badly when using the "zoomed" mode on iOS 9 on an iPhone6s. |
+1 for commenting out 77 & 78. It feels like that's the sort of thing with far-reaching implications, but I'm unable to find any alignment issues that have been hurt by this. On the contrary, together with passing |
My fix for this issue was to add the ability to pass extra props to the text element ( var disableFontScaling = ComposedComponent => class extends React.Component {
render() {
return <ComposedComponent {...this.props} textPropsIOS={{allowFontScaling:false}} />
}
}
export default disableFontScaling(createIconSet(glyphMap, 'FSIcon')); |
I've done a pretty major refactor in the inline-refactor branch that should solve this issue. It breaks some backwards compatibility so please test it before I merge. |
Fixed in 0.8.0. |
Noticed this on when testing with the large iPhone for the first time and was perplexed, glad to have found this with a quick search! Thanks :) |
Great, thanks. |
When accessibility options for larger text are enabled all text sizes are increased (react native behaviour - for now allowFontScaling=true is default)
So I globally set this to false for all text objects so icons and text stayed the correct size, but there is still an issue and the bottom of the icon is cut off.
I have traced the issue down to this line: https://github.com/oblador/react-native-vector-icons/blob/master/lib/create-icon-set.js#L71 When this is commented out there is no issue
The issue can be reproduced by creating any Text element and defining both a height and lineHeight value that are equal
So is the lineHeight style necessary?
The text was updated successfully, but these errors were encountered: