imnapo / react-native-cn-quill

Quill rich-text editor for react-native
MIT License
190 stars 77 forks source link

Is there a component which shows the entered text in a non-editable way? #73

Open filipstev opened 3 years ago

FabianMeul commented 3 years ago

I achieved this using the following workaround;

...
useEffect(() => {
  // This may be redundant, but let's set it to be sure
  quillEditor.current?.enable(false)
}, [])
...
...
<View pointerEvents="none">
  <QuillEditor
    ref={quillEditor}
 />
</View>
...
filipstev commented 3 years ago

Thanks! I also used the getContents() to store the value of the first editor and then used setContents() on the second one. But would your solution be scrollable if there's loads of text?

FabianMeul commented 3 years ago

Because of the wrapping View it wouldn't be scrollable.

Our use case renders the content completely in a wrapping ScrollView using the autoSize feature. Small bugfix for that is here: https://github.com/imnapo/react-native-cn-quill/pull/72