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
971 stars 59 forks source link

Doesn't scroll on multiline TextInput #78

Closed afonso-tsx closed 3 years ago

afonso-tsx commented 3 years ago

Hey! I'm trying to use the autoscroll with a multiline input, it seems to work fine if it's a normal textinput, but with multiline prop there is no scroll whatsoever, thanks!

douglasjunior commented 3 years ago

You need to call a KeyboardManager.reloadLayoutIfNeeded() on the TextInput.onLayout event.

<TextInput
            multiline={true}
            onLayout={() => {
              // When the input size (textarea) changes, it updates the keyboard position.
              KeyboardManager.reloadLayoutIfNeeded();
            }}
          />

For more details, see the Sample Project.

afonso-tsx commented 3 years ago

Thanks for the response, I tried this but no success, since it was also in other closed issues.

douglasjunior commented 3 years ago

The sample project:

ios keyboard