mirror of https://github.com/laurent22/joplin.git
Chore: Fix scroll on iOS -- only pass scrollEnabled=false if we aren't scrolling the outermost view (#6925)
parent
0d5f96f5bb
commit
1fe6910089
|
@ -51,6 +51,10 @@ interface Props {
|
||||||
// Initial javascript. Must evaluate to true.
|
// Initial javascript. Must evaluate to true.
|
||||||
injectedJavaScript: string;
|
injectedJavaScript: string;
|
||||||
|
|
||||||
|
// iOS only: Scroll the outer content of the view. Set this to `false` if
|
||||||
|
// the main view container doesn't scroll.
|
||||||
|
scrollEnabled?: boolean;
|
||||||
|
|
||||||
style?: StyleProp<ViewStyle>;
|
style?: StyleProp<ViewStyle>;
|
||||||
onMessage: OnMessageCallback;
|
onMessage: OnMessageCallback;
|
||||||
onError: OnErrorCallback;
|
onError: OnErrorCallback;
|
||||||
|
@ -118,8 +122,6 @@ const ExtendedWebView = (props: Props, ref: Ref<WebViewControl>) => {
|
||||||
|
|
||||||
// - `setSupportMultipleWindows` must be `true` for security reasons:
|
// - `setSupportMultipleWindows` must be `true` for security reasons:
|
||||||
// https://github.com/react-native-webview/react-native-webview/releases/tag/v11.0.0
|
// https://github.com/react-native-webview/react-native-webview/releases/tag/v11.0.0
|
||||||
// - `scrollEnabled` prevents iOS from scrolling the document (has no effect on Android)
|
|
||||||
// when an editable region (e.g. a the full-screen NoteEditor) is focused.
|
|
||||||
return (
|
return (
|
||||||
<WebView
|
<WebView
|
||||||
style={{
|
style={{
|
||||||
|
@ -127,7 +129,7 @@ const ExtendedWebView = (props: Props, ref: Ref<WebViewControl>) => {
|
||||||
...(props.style as any),
|
...(props.style as any),
|
||||||
}}
|
}}
|
||||||
ref={webviewRef}
|
ref={webviewRef}
|
||||||
scrollEnabled={false}
|
scrollEnabled={props.scrollEnabled}
|
||||||
useWebKit={true}
|
useWebKit={true}
|
||||||
source={source}
|
source={source}
|
||||||
setSupportMultipleWindows={true}
|
setSupportMultipleWindows={true}
|
||||||
|
|
|
@ -356,6 +356,8 @@ function NoteEditor(props: Props, ref: any) {
|
||||||
console.error('NoteEditor: webview error');
|
console.error('NoteEditor: webview error');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// - `scrollEnabled` prevents iOS from scrolling the document (has no effect on Android)
|
||||||
|
// when an editable region (e.g. a the full-screen NoteEditor) is focused.
|
||||||
return (
|
return (
|
||||||
<View style={{
|
<View style={{
|
||||||
...props.style,
|
...props.style,
|
||||||
|
@ -376,6 +378,7 @@ function NoteEditor(props: Props, ref: any) {
|
||||||
<ExtendedWebView
|
<ExtendedWebView
|
||||||
webviewInstanceId='NoteEditor'
|
webviewInstanceId='NoteEditor'
|
||||||
themeId={props.themeId}
|
themeId={props.themeId}
|
||||||
|
scrollEnabled={false}
|
||||||
ref={webviewRef}
|
ref={webviewRef}
|
||||||
html={html}
|
html={html}
|
||||||
injectedJavaScript={injectedJavaScript}
|
injectedJavaScript={injectedJavaScript}
|
||||||
|
|
Loading…
Reference in New Issue