react-native-zss-rich-text-editor
react-native-zss-rich-text-editor copied to clipboard
Weird scroll behavior when the keyboard is up
Scrolling is weird when the keyboard is up, as shown below:
https://www.youtube.com/watch?v=gqxVmYZ6u-w&feature=youtu.be
This only happens when I use setContentHTML
to set the content. The scrolling is fine if I typed in from a fresh start.
This behaviour happens in the example project too
react-native-zss-rich-text-editor/src/RichTextEditor.js
origin) const editorAvailableHeight = Dimensions.get('window').height - keyboardHeight - spacing; ==> my code) const editorAvailableHeight = Dimensions.get('window').height - (keyboardHeight*2) - spacing;
@rasselll Hi I have just tried your fix and the scrolling still only takes half of the space
@ethanyuwang
I ended up solving it using the prop
contentInset={{ bottom: 140 }}
on the editor which is applied as extra spacing.
@arneson Saviour!
When I set contentInset={{ bottom: 140 }},there is an empty view in VC, If users touch that area,the keyboard can't be raised up,
@949699582 I have not experienced that. You might be able either solve it using style rules or hack it by adding a tap listener on that area.
@ethanyuwang I ended up solving it using the prop
contentInset={{ bottom: 140 }}
on the editor which is applied as extra spacing.
this was okay when keyboard is up. But if editing without keyboard showing up, it fails, empty spaces appear at the bottom (like pasting text from outside)
@hctangaa I have not experienced that, but I'm unsure if we have that use-case. I guess you could control whether or not to pass the prop based on keyboard state? Are you pasting without focusing what so ever or just keeping the keyboard down?