react-native-macos/Libraries/Components/Keyboard
Gabriel Donadel Dall'Agnol 4b9382c250 fix: KeyboardAvoidingView height when "Prefer Cross-Fade Transitions" is enabled (#34503)
Summary:
Fix `KeyboardAvoidingView`  height on iOS when "Prefer Cross-Fade Transitions" is enabled by adding an additional check to `_relativeKeyboardHeight` verifying if `prefersCrossFadeTransitions()` is true and `keyboardFrame.screenY` is `0` and treating this special case. The issue was caused  by the native RCTKeyboardObserver where the `endFrame` reported by `UIKeyboardWillChangeFrameNotification` returns `height = 0` when Prefer Cross-Fade Transitions" is enabled
and unfortunelly there isn't much we can do on the native side to fix it.

Closes https://github.com/facebook/react-native/issues/31484
Closes https://github.com/facebook/react-native/issues/29974

## Changelog

[iOS] [Fixed] - Fix KeyboardAvoidingView height when "Prefer Cross-Fade Transitions" is enabled

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

Test Plan:
**On iOS 14+**

1.  Access Settings > "General" > "Accessibility" > "Reduce Motion", enable "Reduce Motion" then enable "Prefer Cross-Fade Transitions".
2. Open the RNTester app and navigate to the KeyboardAvoidingView page
3. Focus and blur inputs and observe the keyboard behaving correctly

https://user-images.githubusercontent.com/11707729/186822671-801872be-7db1-4c5c-904b-1987441c1326.mov

Reviewed By: jacdebug

Differential Revision: D39055213

Pulled By: cipolleschi

fbshipit-source-id: fac17cbe02867e0fe522397f6cb59a8b51c1840f
2022-08-31 07:48:27 -07:00
..
__tests__ Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
Keyboard.js Let ScrollView Know About Keyboard Opened Before Mount 2022-08-18 15:05:43 -07:00
KeyboardAvoidingView.js fix: KeyboardAvoidingView height when "Prefer Cross-Fade Transitions" is enabled (#34503) 2022-08-31 07:48:27 -07:00
NativeKeyboardObserver.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00