[Android] TextInput jerks up and down on focus and blur
See original GitHub issueDescribe the bug
When using a TextInput in Modalize, focus and blur cause the modal to resize itself only after the keyboard appears. This only occurs on Android devices and it does not seem to matter which settings I choose unless I don’t set the height and have adjustContentToHeight={true}
.
Example
<Modalize
ref={modalRef}
disableScrollIfPossible
modalHeight={520}
avoidKeyboardLikeIOS={false}
keyboardAvoidingOffset={0}
adjustToContentHeight={false}
>
<View>
<TextInput
style={{ backgroundColor: "red" }}
/>
</View>
</Modalize>
Another Example
<Modalize
ref={modalRef}
disableScrollIfPossible
modalHeight={520}
avoidKeyboardLikeIOS={true}
keyboardAvoidingOffset={100}
adjustToContentHeight={false}
>
<View>
<TextInput
style={{ backgroundColor: "red" }}
/>
</View>
</Modalize>
Dependencies:
- react-native-modalize [2.0.6]
- react-native [e.g. 0.62.2]
- react-native-gesture-handler [1.6.0]
- expo/react-navigation/react-native-navigation: [expo @38.0.0]
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
React native text input blur/focus issue - Stack Overflow
In my case focus jumps from one textinput to another when option is enabled and it only happens for android api level <...
Read more >Focusing: focus/blur - The Modern JavaScript Tutorial
The focus event is called on focusing, and blur – when the element loses the focus. Let's use them for validation of an...
Read more >modal with text input display up and down when input ... - GitHub
Open a long page with some text and one button in the middle of page using Android Chrome browser. Scroll the page to...
Read more >Handle input method visibility | Android Developers
When input focus moves in or out of an editable text field, Android shows or hides the input method—such as the on-screen keyboard—as ......
Read more >Fixed header jumps down when keyboard opens on focus ...
I found a way around it. Here it is for future reference if anyone has a similar issue. First you need Modernizr to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks like a potential fix for this issue is using the new SDK 38 android setting as follows:
I believe if you’re not using expo the same issue may be fixed with android:windowSoftInputMode=“adjustPan” in your android manifest.
Can anyone else confirm this is a suitable fix? I will close the issue if so
update to expo SDK 38 and add the code above to your app.json file