react-native-zss-rich-text-editor icon indicating copy to clipboard operation
react-native-zss-rich-text-editor copied to clipboard

Weird scroll behavior when the keyboard is up

Open ethanyuwang opened this issue 6 years ago • 8 comments

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

ethanyuwang avatar Jun 11 '18 23:06 ethanyuwang

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 avatar Jun 14 '18 13:06 rasselll

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

ethanyuwang avatar Jun 22 '18 17:06 ethanyuwang

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

arneson avatar Oct 12 '18 10:10 arneson

@arneson Saviour!

export-mike avatar Nov 05 '18 12:11 export-mike

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 avatar Nov 27 '18 03:11 949699582

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

arneson avatar Nov 27 '18 08:11 arneson

@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 avatar Jan 04 '19 07:01 hctangaa

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

arneson avatar Jan 04 '19 09:01 arneson