diff --git a/packages/app-mobile/components/NoteBodyViewer/hooks/useSource.ts b/packages/app-mobile/components/NoteBodyViewer/hooks/useSource.ts index 20d5c5de0..237b3630f 100644 --- a/packages/app-mobile/components/NoteBodyViewer/hooks/useSource.ts +++ b/packages/app-mobile/components/NoteBodyViewer/hooks/useSource.ts @@ -151,12 +151,6 @@ export default function useSource( const resourceDownloadMode = Setting.value('sync.resourceDownloadMode'); - // On iOS, the root container has slow inertial scroll, which feels very different from - // the native scroll in other apps. This is not the case, however, when a child (e.g. a div) - // scrolls the content instead. - // Use a div to scroll on iOS instead of the main container: - const scrollRenderedMdContainer = shim.mobilePlatform() === 'ios'; - const js = []; js.push('try {'); js.push(shim.injectedJs('webviewLib')); @@ -165,8 +159,7 @@ export default function useSource( js.push('window.joplinPostMessage_ = (msg, args) => { return window.ReactNativeWebView.postMessage(msg); };'); js.push('webviewLib.initialize({ postMessage: msg => { return window.ReactNativeWebView.postMessage(msg); } });'); js.push(` - const scrollingElement = - ${scrollRenderedMdContainer ? 'document.querySelector("#rendered-md")' : 'document.scrollingElement'}; + const scrollingElement = document.scrollingElement; let lastScrollTop; const onMainContentScroll = () => { const newScrollTop = scrollingElement.scrollTop; @@ -232,19 +225,6 @@ export default function useSource( font: -apple-system-body; } } - - :root > body { - padding: 0; - } - `; - const scrollRenderedMdContainerCss = ` - body > #rendered-md { - width: 100vw; - overflow: auto; - height: calc(100vh - ${paddingBottom}px - ${paddingTop}); - padding-bottom: ${paddingBottom}px; - padding-top: ${paddingTop}; - } `; const defaultCss = ` code { @@ -263,7 +243,6 @@ export default function useSource( ${assetsToHeaders(result.pluginAssets, { asHtml: true })}