Skip to content

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

@kirandchavan

Description

@kirandchavan

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions