-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyboardAwareScrollView compatibility issue with react-navigation@7+ presentation 'formSheet' #726
Comments
@kimak well, if you can prepare a reproduction that would be really great 👍 I'm just afraid that fixing this problem may involve |
@kirillzyusko I found some time to make a reproductible demo https://github.com/kimak/keyboardAwareScrollFormSheet/ keyboard_reproductible.movLet me know if the bug happen to this lib or if it's only related to react-native-screens formSheet. Thanks for your help |
Thank you @kimak for a reproduction example ❤️ Appreciate it! From what I see:
From what I see you applied a hack to make view elements be in the center by adding fake view with In you If you modify you component as (i. e. in your case apply double padding - from top and bottom): <KeyboardAwareScrollView bottomOffset={50} style={{flex: 1}}>
{children}
<TextInput placeholder={placeholder} />
{children}
</KeyboardAwareScrollView> Then it will start to work. I think the problem should be fixed in Alternatively you can try to specify container: {
justifyContent: "center",
alignItems: "center",
flex: 1,
+ minHeight: Dimensions.get("screen").height,
}, Let me know if I answered your question or if you have any additional questions 😊 🙌 |
formSheet has issues with ScrollView in general software-mansion/react-native-screens#2424 |
Thanks, @kirillzyusko! Your explanations are very clear 🙏. I will close this ticket as the issue is definitely related to react-native-screens. Also, thanks to @radko93 for pointing out the original ScrollView issue. The minHeight hack can be a helpful workaround while we wait for a better fix:
Side note: The Dimensions height value works only if the Stack.Screen doesn't have a header:
Otherwise, we need to account for the header height when setting the minHeight. |
Describe the bug
react-navigation@7 has introduced
formSheet
support recentlyreact-navigation/react-navigation#12032
By using it it breaks
KeyboardAwareScrollView
behavior.Code snippet
❌ KeyboardAwareScrollView flickering with a TextInput inside the view
✅ KeyboardAwareScrollView working fine with a TextInput inside the view
Repo for reproducing
The pbm is easy to reproduce with the latest version of react-navigation but let me know and I can create one if needed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Same behavior as with
presentation: 'modal'
.The text was updated successfully, but these errors were encountered: