react-native/Libraries/Components
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
..
AccessibilityInfo Add flow suppressions to xplat android 2018-08-13 11:16:41 -07:00
ActivityIndicator Add flow suppressions to xplat android 2018-08-13 11:16:41 -07:00
AppleTV Spread TVViewProps into ViewProps instead of intersection 2018-05-12 10:35:26 -07:00
CheckBox Deprecate View prop-type definitions 2018-08-22 18:31:36 -07:00
Clipboard Adding flow strict local to remaining possible files in xplat/JS 2018-08-09 08:54:44 -07:00
DatePicker RN: Remove Native Prop Validation 2018-06-01 12:54:14 -07:00
DatePickerAndroid Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
DrawerAndroid Deprecate View prop-type definitions 2018-08-22 18:31:36 -07:00
Keyboard Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
MaskedView Deprecate View prop-type definitions 2018-08-22 18:31:36 -07:00
Navigation Deprecate View prop-type definitions 2018-08-22 18:31:36 -07:00
Picker Deprecate View prop-type definitions 2018-08-22 18:31:36 -07:00
ProgressBarAndroid Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
ProgressViewIOS Deprecate View prop-type definitions 2018-08-22 18:31:36 -07:00
RefreshControl Adding flow strict local to remaining possible files in xplat/JS 2018-08-09 08:54:44 -07:00
SafeAreaView Deprecate View prop-type definitions 2018-08-22 18:31:36 -07:00
ScrollView ScrollView snapToStart/snapToEnd 2018-08-30 13:04:50 -07:00
SegmentedControlIOS Deprecate View prop-type definitions 2018-08-22 18:31:36 -07:00
Slider Fix more forwardRef displayNames 2018-06-19 14:17:19 -07:00
StatusBar Add flow suppressions to xplat android 2018-08-13 11:16:41 -07:00
Switch Move Switch native require call to new file 2018-08-08 15:03:01 -07:00
TabBarIOS Deprecate View prop-type definitions 2018-08-22 18:31:36 -07:00
TextInput iOS: Add a maxFontSizeMultiplier prop to <Text> and <TextInput> (#20915) 2018-09-04 17:50:42 -07:00
TimePickerAndroid Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
ToastAndroid Replace '@flow strict(-local)' with '@flow' in .android.js files 2018-08-08 10:48:19 -07:00
ToolbarAndroid Deprecate View prop-type definitions 2018-08-22 18:31:36 -07:00
Touchable A11Y: Leverage New `AccessibilityProps` Props 2018-08-23 00:18:47 -07:00
UnimplementedViews Adding flow strict local to remaining possible files in xplat/JS 2018-08-09 08:54:44 -07:00
View RN: Improve ViewPropTypes 2018-08-29 17:49:24 -07:00
ViewPager Deprecate View prop-type definitions 2018-08-22 18:31:36 -07:00
WKWebView Move WKWebView into WebView.ios.js 2018-08-16 16:52:44 -07:00
WebView Deprecate View prop-type definitions 2018-08-22 18:31:36 -07:00
Button.js accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 2/3 2018-07-25 23:48:26 -07:00
ScrollResponder.js Fix keyboard handling with keyboardShouldPersistTaps: never 2018-05-14 23:46:50 -07:00
StaticContainer.react.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
StaticRenderer.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
Subscribable.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00