You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that spawning a KeyboardAvoidingView while a keyboard is already up causes it to not initialize correctly. I believe its because it just assumes the keyboard is not shown yet. There is already a flow where it handles a null keyboard event when an onLayout happens but it just sets the height to 0. In my case I just use the Keyboard API to query the state and set it instead which works for me. I only tested this on iOS so I'm not making a full PR but I figured i'd document this in case others run into this issue
Description
I noticed that spawning a KeyboardAvoidingView while a keyboard is already up causes it to not initialize correctly. I believe its because it just assumes the keyboard is not shown yet. There is already a flow where it handles a
null
keyboard event when anonLayout
happens but it just sets the height to0
. In my case I just use theKeyboard
API to query the state and set it instead which works for me. I only tested this on iOS so I'm not making a full PR but I figured i'd document this in case others run into this issueReact Native Version
0.70.7
Output of
npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 13.2.1
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 60.61 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 19.7.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.5.0 - /usr/local/bin/npm
Watchman: 2023.02.20.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 28, 30, 31, 33
Build Tools: 30.0.2, 30.0.3, 31.0.0, 32.0.0, 33.0.0
System Images: android-31 | Google APIs Intel x86 Atom_64, android-33 | Google APIs Intel x86 Atom_64
Android NDK: 23.1.7779620
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9123335
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.18 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.7 => 0.70.7
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
KeyboardAvoidingView
(on ios i'm usingpadding
)state
hasbottom: 0
and it's layout is incorrectSnack, code example, screenshot, or link to a repository
n/a
The text was updated successfully, but these errors were encountered: