Skip to content
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

How to Disable fontScale for Card Title, subTitle & also for react-native-paper components #4565

Open
kirandchavan opened this issue Nov 28, 2024 · 0 comments
Labels

Comments

@kirandchavan
Copy link

Current behaviour

I am trying to disable the fontScaling (this is required in my app) all the cases are working except react-native-paper.

This is the code I have added in index.js (root file)
`Text.defaultProps = Text.defaultProps || {};
Text.defaultProps.allowFontScaling = false;
Text.defaultProps = {maxFontSizeMultiplier: 1};

TextInput.defaultProps = {};
TextInput.defaultProps.allowFontScaling = false;`

for all the Text and TextInput component it works except react-native-paper component.

any solution on this?

Expected behaviour

It should disable font scaling

How to reproduce?

on iOS change the display to "Larger text"

What have you tried so far?

This is the code I have added in index.js (root file)
`Text.defaultProps = Text.defaultProps || {};
Text.defaultProps.allowFontScaling = false;
Text.defaultProps = {maxFontSizeMultiplier: 1};

TextInput.defaultProps = {};
TextInput.defaultProps.allowFontScaling = false;`

Your Environment

software version
ios x
android x
react-native 0.72.3
react-native-paper 4.11.2
node 18.12.0
npm or yarn yarn/npm
expo sdk x.x.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant