capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

API to disable <body> scrolling

Open manucorporat opened this issue 7 years ago • 10 comments

https://github.com/ionic-team/cordova-plugin-ionic-webview/blob/486d412ad365b76aae40b25c758551310368a35b/src/ios/CDVWKWebViewEngine.m#L649

Ionic works better if the <body> scrolling is completely disabled.

Some possible solution

  • Provide an API that ionic can use without importing capacitor directly
  • Provide some API that can be used directly using the capacitor config, so ionic starters can be preconfigured to disable scrolling
  • Provide some runtime API so the value can be changed later by the developer.

manucorporat avatar Dec 13 '18 13:12 manucorporat

(notice the scroll bar on the right) this is with content that shouldn't scroll (and doesn't scroll on web). image

corysmc avatar Dec 13 '18 15:12 corysmc

Agreed, this is also an obstacle when creating scrollable components.

YajJackson avatar Dec 13 '18 18:12 YajJackson

We could easily just disable it. I think we do that by default in Ionic's config.xml for our starters, no?

mlynch avatar Dec 13 '18 18:12 mlynch

@mlynch you are right! it would be great to provide it as a option in capacitor.config.js as well as a runtime option.

Do we have a Webview Plugin? so app can customize things about the webview itself?

manucorporat avatar Dec 14 '18 01:12 manucorporat

FYI, after removing some hacky css we had to account for iPhone X (thanks @manucorporat ) we no longer see the scrollbar - so I'm not seeing the bug anymore

corysmc avatar Dec 15 '18 21:12 corysmc

Next version of ionic will include the CSS hack, so you should remove it completely! Also kudos to @jcesarmobile for the CSS fix!

I also think we still need the scrollEnabled option, i might another bug in Sworkit because of this, i believe it should be fixed by disabling the body scroll

manucorporat avatar Dec 17 '18 10:12 manucorporat

Capacitor doesn't have a webview plugin, it's just core to the engine. It can/should be configured just like any other plugin though

mlynch avatar Dec 17 '18 13:12 mlynch

@mlynch not sure if you saw I sent a PR that allows to configure it like this.

"ios": {
      "scrollEnabled": false
}

Do you mean it should be like this instead?

"plugins": {
    "WebView": {
      "scrollEnabled": false
    }
  }

jcesarmobile avatar Dec 18 '18 18:12 jcesarmobile

Is there any way for android to hide the scroll bar?

devin-lemcke avatar Jul 28 '20 16:07 devin-lemcke

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Nov 11 '22 12:11 ionitron-bot[bot]