question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[iOS] keyboardAvoidingOffset prop not working properly

See original GitHub issue

Description I have an input as my FooterComponent & I set keyboardAvoidingBehavior="padding" (the default). When the input is focused, the modal receives a weird height.

Also, if I don’t set keyboardAvoidingOffset, I can’t see my input on focus. But if I do (here I set it as 180), the offset remains even when my input is blurred.

Reproduce keyboardAvoidingOffset={0}

no offset

keyboardAvoidingOffset={180}

offset

Dependencies:

  • react-native-modalize: 1.3.7-rc.23
  • react-native: 0.61.5
  • react-native-gesture-handler: ^1.6.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jeremybarbetcommented, Apr 19, 2020

About the issue with the bottom tab bar you can use react-native-portalize to be able to display Modalize on top of the router.

I made the changes there https://snack.expo.io/@jeremdsgn/react-native-modalize-issues-176-and-177

I will dig more for the rest of the problems!

Edit: Just saw you use panGestureEnabled at the wrong place. It’s a Modalize’s props, and not a FlatList’s props. Adding it works, well at least you don’t have the jump happening and it can be a good first workaround. To be continued…

Edit 2: With panGestureEnabled={false} and commenting out

// keyboardAvoidingBehavior={Platform.OS === 'ios' ? 'padding' : 'height'}
// keyboardAvoidingOffset={Platform.OS === 'ios' ? 110 : 0}

the input is fixed at the bottom and follow the keyboard. On both Android/iOS. Can you confirm it with your real app?

If that’s so it means that the only issue is related to inverted: true and panGestureEnabled={true}

0reactions
jeremybarbetcommented, Apr 20, 2020

Cool that’s good to hear! If there was anything you didn’t understand in the documentation, feel free to open PR to make clearer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

KeyboardAvoidingView not Working Properly - Stack Overflow
KeyboardAvoidingView not Working Properly · 1. Try removing paddingBottom: this. · still not working@HSBP. – Charan Teja · Use ...
Read more >
iOS KeyboardAvoidingView not Entirely Avoiding Keyboard
Description I'm trying to use a keyboard avoiding view to basically push up the entire app window on iOS (mocking the behavior seen...
Read more >
KeyboardAvoidingView not working properly? Check your ...
KeyboardAvoidingView not working properly? Check your Flexbox Layout first. Keyboard overlaying Input or Submit button is a common problem in ...
Read more >
KeyboardAvoidingView - React Native
KeyboardAvoidingView. This component will automatically adjust its height, position, or bottom padding based on the keyboard height to ...
Read more >
keyboardavoidingview ios not working - You.com | The search ...
Problem : I am using KeyboardAvoidingView in ios with behavior="padding" but it's not working. My screen has four text input fields, which get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found