Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable font scaling ( dynamic types from accessibility) for text inputs in react native?

How to disable font scaling (dynamic types - accessibility) for text inputs in react native?

I have disabled dynamic types for text in the app by adding this code, but I still see that font in TextInputs are scaling:

 Text.defaultProps = Text.defaultProps || {}; //Disable dynamic type in IOS
 Text.defaultProps.allowFontScaling = false;
like image 788
Lucky_girl Avatar asked Feb 03 '26 02:02

Lucky_girl


1 Answers

Okay, I found the solution, it can be done the same way as it was done with Text:

TextInput.defaultProps = Text.defaultProps || {}; //Disable dynamic type in IOS
TextInput.defaultProps.allowFontScaling = false;
like image 156
Lucky_girl Avatar answered Feb 04 '26 15:02

Lucky_girl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!