react-native/Libraries/Text
Adam Comella 01d5eff425 iOS: Add a maxFontSizeMultiplier prop to <Text> and <TextInput> (#20915)
Summary:
**Motivation**

Whenever a user changes the system font size to its maximum allowable setting, React Native apps that allow font scaling can become unusable because the text gets too big. Experimenting with a native app like iMessage on iOS, the font size used for non-body text (e.g. header, navigational elements) is capped while the body text (e.g. text in the message bubbles) is allowed to grow.

This PR introduces a new prop on `<Text>` and `<TextInput>` called `maxFontSizeMultiplier`. This enables devs to set the maximum allowed text scale factor on a Text/TextInput. The default is 0 which means no limit.

Another PR will add this feature to Android.

**Test Plan**

I created a test app which utilizes all categories of values of `maxFontSizeMultiplier`:
  - `undefined`: inherit from parent
  - `0`: no limit
  - `1`, `1.2`: fixed limits

I tried this with `Text`, `TextInput` with `value`, and `TextInput` with children. For `Text`, I also verified that nesting works properly (if a child `Text` doesn't specify `maxFontSizeMultiplier`, it inherits it from its parent).

Lastly, we've been using a version of this in Skype for several months.

**Release Notes**

[GENERAL] [ENHANCEMENT] [Text/TextInput] - Added maxFontSizeMultiplier prop to prevent some text from getting unusably large as user increases OS's font scale setting (iOS)

Adam Comella
Microsoft Corp.
Pull Request resolved: https://github.com/facebook/react-native/pull/20915

Differential Revision: D9646739

Pulled By: shergin

fbshipit-source-id: c823f59c1e342c22d6297b88b2cb11c5a1f10310
2018-09-04 17:50:42 -07:00
..
BaseText iOS: Add a maxFontSizeMultiplier prop to <Text> and <TextInput> (#20915) 2018-09-04 17:50:42 -07:00
RCTText.xcodeproj Update Xcode projects (#19574) 2018-06-19 23:48:12 -07:00
RawText Update license headers for MIT license 2018-02-16 18:31:53 -08:00
Text iOS: Add a maxFontSizeMultiplier prop to <Text> and <TextInput> (#20915) 2018-09-04 17:50:42 -07:00
TextInput Exposed scrollEnabled on TextInput (#19330) 2018-08-08 18:46:53 -07:00
VirtualText Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTConvert+Text.h iOS: fix up RNTesterPods 2018-05-16 14:14:41 -07:00
RCTConvert+Text.m iOS textTransform style support 2018-04-16 09:01:38 -07:00
RCTTextAttributes.h iOS: Add a maxFontSizeMultiplier prop to <Text> and <TextInput> (#20915) 2018-09-04 17:50:42 -07:00
RCTTextAttributes.m iOS: Add a maxFontSizeMultiplier prop to <Text> and <TextInput> (#20915) 2018-09-04 17:50:42 -07:00
RCTTextTransform.h iOS textTransform style support 2018-04-16 09:01:38 -07:00
Text.js iOS: Add a maxFontSizeMultiplier prop to <Text> and <TextInput> (#20915) 2018-09-04 17:50:42 -07:00
TextAncestor.js Flow strictify possible files in RN core 2018-06-20 00:47:21 -07:00
TextPropTypes.js iOS: Add a maxFontSizeMultiplier prop to <Text> and <TextInput> (#20915) 2018-09-04 17:50:42 -07:00
TextProps.js Add onTextLayout to TextProps 2018-08-30 09:33:05 -07:00
TextStylePropTypes.js Android textTransform style support (#20572) 2018-08-13 21:31:57 -07:00