Skip to content

Commit

Permalink
Merge pull request #4 from Meruem5/fix/webview-scroll
Browse files Browse the repository at this point in the history
Disable nested scroll when autosize is enabled
  • Loading branch information
Meruem5 authored Mar 23, 2023
2 parents 8b56794 + c0624af commit acc5fab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-cn-quill",
"version": "0.7.17",
"version": "0.7.18",
"description": "react-native quill richtext editor",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
11 changes: 7 additions & 4 deletions src/editor/quill-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,12 @@ export default class QuillEditor extends React.Component<
content: string,
style: StyleProp<ViewStyle>,
props: WebViewProps = {}
) => (
<WebView
) => {
const { autoSize } = this.props;

return <WebView
scrollEnabled={false}
nestedScrollEnabled={true}
nestedScrollEnabled={!autoSize}
hideKeyboardAccessoryView={true}
keyboardDisplayRequiresUserAction={false}
originWhitelist={['*']}
Expand All @@ -400,13 +402,14 @@ export default class QuillEditor extends React.Component<
automaticallyAdjustContentInsets={true}
bounces={false}
dataDetectorTypes="none"
showsVerticalScrollIndicator={!autoSize}
{...props}
javaScriptEnabled={true}
source={{ html: content }}
ref={this._webview}
onMessage={this.onMessage}
/>
);
};

render() {
const { webviewContent, height } = this.state;
Expand Down

0 comments on commit acc5fab

Please sign in to comment.