douglasjunior / react-native-keyboard-manager

⚛ Library to prevent issues of keyboard sliding up and cover inputs on React-Native iOS projects.
https://www.npmjs.com/package/react-native-keyboard-manager
MIT License
952 stars 60 forks source link

Update IQKeyboardManager to version 6 #68

Closed douglasjunior closed 3 years ago

douglasjunior commented 4 years ago

Use this space to talk about the IQKeyboardManager update, report bugs, requests, etc.

To try this version, use:

yarn add react-native-keyboard-manager@alpha

Or

npm i -S react-native-keyboard-manager@alpha

Because IQKeyboardManager is written in Swift, you need to enable Swift on your native Xcode project.

  1. Open ios/YourAppName.xcworkspace in Xcode
  2. Right-click on YourAppName in the Project Navigator on the left, and click New File.
  3. Create a single empty Swift file to the project (make sure that YourAppName target is selected when adding)
  4. When Xcode asks, press Create Bridging Header and do not remove Swift file then.
  5. Re-run your build.

More installation details: https://github.com/douglasjunior/react-native-keyboard-manager/blob/iqkeyboardmanager-update/README.md

The update is started by @zoontek on #64, but I need help to validate, track and release this version.

This change represents a major update in IQKeyboardManager, so there are some questions to be answered:

douglasjunior commented 3 years ago

Bump version 6.5.4-alpha.2

longprao commented 3 years ago

@douglasjunior I'm using this version, it works fine so far, including in modal, however, I have a question. If I use it in a page with FlatList, it will only work if the FlatList is the only element in the screen. If there is other element outside of it, it will make the screen jump out and overflow.

Keyboard off:

IMG_5135

Keyboard on:

IMG_5136

The code is something like this:

<SafeAreaView style={globalStyles.safeArea}>
  <FlatList... />
  <CommentForm postId={data.id} />
</SafeAreaView>

So if I put the CommentForm inside FlatList ListHeaderComponent or ListFooterComponent, it should be fine, but I don't want that as it will make the UI more complex to achive the design (or not? I'm new to RN so not sure).

How to make it stay inside the screen as show below?

IMG_5137

douglasjunior commented 3 years ago

Hi @longprao, thanks for the feedback!

As mentioned here #63, I think that IQKeyboardManager don't will help in this case, so de best option is to use something like the KeyboardAvoidingView.

douglasjunior commented 3 years ago

Closing https://github.com/douglasjunior/react-native-keyboard-manager/releases/tag/6.5.4-0