ionic-team / cordova-plugin-ionic-keyboard

Keyboard Plugin for Cordova
Other
192 stars 177 forks source link

feat(ios): reimplement disableScroll method #102

Closed jcesarmobile closed 5 years ago

jcesarmobile commented 5 years ago

Closes #42

thomashilzendegen commented 4 years ago

One thing bothers me: the default behavior is now a disabled scrolling. Was this intended?

jcesarmobile commented 4 years ago

Yeah, as the README says, this plugin is intended to be used with cordova-plugin-ionic-webview, and that plugin always had ScrollEnabled set to false by default, so cordova-plugin-ionic-keyboard plugin uses the same default.

thomashilzendegen commented 4 years ago

Yep, that's right, the webview plugin does this by itself with this line (https://github.com/ionic-team/cordova-plugin-ionic-webview/blob/7a514b071ba2c094e02f56f46f2e90a2a3a1e9be/src/ios/CDVWKWebViewEngine.m#L483):

wkWebView.scrollView.scrollEnabled = [settings cordovaBoolSettingForKey:@"ScrollEnabled" defaultValue:NO];

In that case, I am asking me, why is this also re-implemented in this plugin but wasn't before resulting in a breaking change if this plugin is used on its own...

jcesarmobile commented 4 years ago

That was just a setting to enable or disable the scroll for the whole app.

This PR adds an API to enable it or disable it programmatically when needed, as it was requested by a few people, because the previous keyboard plugin had that API but was lost in this new implementation.

I had to read that setting to not break the webview plugin, but didn't think on the people not using the webview plugin. Feel free to report an issue where you say it's a breaking change and should be reverted.