react-native-macos/packages
Justin Huntington bc1e602e0c Add ScrollView.automaticallyAdjustsScrollIndicatorInsets prop (on iOS) (#29809)
Summary:
iOS 13 added a new property to `UIScrollView`: `automaticallyAdjustsScrollIndicatorInsets`, which is `YES` by default.  The property changes the meaning of the `scrollIndicatorInsets` property.  When `YES`, any such insets are **in addition to** whatever insets would be applied by the device's safe area.  When `NO`, the iOS <13 behavior is restored, which is for such insets to not account for safe area.

In other words, this effects ScrollViews that underlay the device's safe area (i.e. under the notch).  When `YES`, the OS "automatically" insets the scroll indicators, when `NO` it does not.

There are two problems with the default `YES` setting:

1. It means applying `scrollIndicatorInsets` to a `ScrollView` has a different effect on iOS 13 versus iOS 12.
2. It limits developers' control over `scrollIndicatorInsets`.  Since negative insets are not supported, if the insets the OS chooses are too large for your app, you cannot fix it.

Further explanation & sample code is available in issue https://github.com/facebook/react-native/issues/28140 .

This change sets the default for this property to `NO`, making the behavior consistent across iOS versions, and allowing developers full control.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Changed] - ScrollView scrollIndicatorInsets to not automatically add safe area on iOS13+

Pull Request resolved: https://github.com/facebook/react-native/pull/29809

Test Plan:
Updated the RNTester example to explain what to expect. Also removed the `pageScreen` modal example for now as mentioned in my Github comment.

{F628636466}

Here are screenshots of the demo app (from the original bug) before (with safe area applied to insets) & after (without safe area applied to insets):

![before](https://user-images.githubusercontent.com/428831/91644197-ea03a700-ea07-11ea-9489-be27820930eb.png)

![after](https://user-images.githubusercontent.com/428831/91644200-eff98800-ea07-11ea-8788-daf1e783639d.png)

Reviewed By: p-sun

Differential Revision: D28229603

Pulled By: lunaleaps

fbshipit-source-id: 2e774ae150b1dc41680b8b7886c7ceac8808136a
2021-07-07 20:23:36 -07:00
..
assets Remove worker param from rn_bundle() macro 2020-11-04 10:10:10 -08:00
babel-plugin-codegen Upgrade babel from 7.12.3 -> 7.14.1 2021-05-13 02:48:09 -07:00
eslint-config-react-native-community chore(version): major version to go with dependency update (#31732) 2021-06-16 11:13:48 -07:00
eslint-plugin-codegen Upgrade babel from 7.12.3 -> 7.14.1 2021-05-13 02:48:09 -07:00
eslint-plugin-react-native-community Accessible colors for DynamicColorIOS (#31651) 2021-06-08 11:51:23 -07:00
normalize-color Deploy Flow v0.146.0 2021-03-06 11:37:57 -08:00
polyfills Update FlowFixMes to use error codes in react-native-github 2021-03-31 18:21:47 -07:00
react-native-codegen Support string type for commands 2021-06-22 15:31:47 -07:00
react-native-gradle-plugin RN project wide Kotlin version (#31645) 2021-06-10 00:46:15 -07:00
rn-tester Add ScrollView.automaticallyAdjustsScrollIndicatorInsets prop (on iOS) (#29809) 2021-07-07 20:23:36 -07:00