wix-incubator / react-native-zss-rich-text-editor

React Native rich text editor based on ZSSRichTextEditor
Other
841 stars 310 forks source link

Weird scroll behavior when the keyboard is up #109

Open ethanyuwang opened 6 years ago

ethanyuwang commented 6 years ago

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

rasselll commented 6 years ago

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;

ethanyuwang commented 6 years ago

@rasselll Hi I have just tried your fix and the scrolling still only takes half of the space

arneson commented 5 years ago

@ethanyuwang I ended up solving it using the prop contentInset={{ bottom: 140 }} on the editor which is applied as extra spacing.

export-mike commented 5 years ago

@arneson Saviour!

949699582 commented 5 years ago

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,

arneson commented 5 years ago

@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.

hctangaa commented 5 years ago

@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)

arneson commented 5 years ago

@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?