Android: Top inset is changed on keyboard dismissal when windowSoftInputMode = adjustPan
See original GitHub issueNot sure if this is the expected behavior, but when windowSoftInputMode is set to adjustPan, the top inset changes significantly after opening and dismissing the keyboard, i.e. the top inset can increase from 0 to over 100 after the keyboard is dismissed.
On Android, the adjustPan input mode automatically shifts the screen upward so that focused text inputs are moved above the software keyboard. This input mode is often recommended for handling input/keyboard avoidance on Android due to inconsistent behavior with KeyboardAvoidingView. I assume that when the app screen is shifted back downwards, the top inset value is set to the Y offset value used to pan the view back into its original position.
If this is expected behavior, it seems inconsistent in that the bottom inset doesn’t change when the pan-upwards effect is performed upon opening the keyboard.
In my particular use case, the fact that the adjustPan mode affects insets makes it difficult to rely on the safe area context insets in places that are intended to account only for the presence of notches: I’m using the top inset to add top padding to a navigation bar but the padding value jumps in size after dismissing the keyboard.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:7

Top Related StackOverflow Question
Fixed in 0.7.0
Same issue here. For now using
react-native-status-bar-heightas @ninjacoder95 suggested.