Open durdevic opened 6 years ago
multiline prop of TextInput with dynamic height is not well supported yet
Hey, @Bobozee I found today this solution by @baijunjie and works really nice for me. Maybe you guys can collaborate to create even better solution 💪
Hey, @Bobozee I found today this solution by @baijunjie and works really nice for me. Maybe you guys can collaborate to create even better solution 💪
Good work! @durdevic Thank you for the hint.
Hello, any update on this?
I tried the package mentioned above but not able to get it working at all either on iOS or Android :(. Also KeyboardAvoidingView
doesn't work for multiline textinputs. Would be so sweet if react-native-keyboard-aware-scroll-view could address this.
I tried react-native-input-scroll-view
, but for me it doesn't work on Android at all :(
Opened an issue about it: https://github.com/baijunjie/react-native-input-scroll-view/issues/45
This worked for me perfectly both for ios and android, hope it will help u
<ScrollView ref={component => { this.myScrollView = component; }}>
<TextInput
multiline
onBlur={() => this.scrollView.scrollTo({ x: 0, y: 0, animated: true })}
onFocus={() => this.myScrollView.scrollTo({ x: 0, y: 200, animated: true })} // <- your coordinates here
/>
</ScrollView>
Try to set your multiline TextInput's scrollEnabled to false.
credit to @klaytaybai
Something like this should work. Item to keep in mind, I needed to consider extraScrollHeight
to make sure the input showed up in the ideal spot.
<KeyboardAwareScrollView
extraScrollHeight={20}
>
<TextInput
multiline={true}
scrollEnabled={false}
/>
</KeyboardAwareScrollView>
I want to create a medium like editor for text, the problem I have is when I write in the multiline TextInput and it goes behind keyboard (because too much height on it) mu so I need to scroll up every time.
Any solutions?
Thanks!