ionic-team / cordova-plugin-ionic-keyboard

Keyboard Plugin for Cordova
Other
193 stars 178 forks source link

disableScroll method disappear #42

Closed Makeon closed 5 years ago

Makeon commented 5 years ago

disableScroll() method disappear in 4.15.0 version what method one need use now?

NMastracchio commented 5 years ago

This boggles my mind. Amidst the sea of seemingly infinite Stack and Ionic forum posts about scrolling/keyboard issues, using the disableScroll method is the most common solution. And yet, they removed it from the currently supported plugin.

mlynch commented 5 years ago

Version 4.15.0 of what? The current keyboard plugin version is 2.1.3

togro commented 5 years ago

disableScroll() method disappear in 4.15.0 version what method one need use now?

On 4.15.0 disappear, I donwgrade version with

npm install --save @ionic-native/keyboard@4.12.0 and works again

Makeon commented 5 years ago

Version 4.15.0 of what? The current keyboard plugin version is 2.1.3 Version 4.15.0 of @ionic-native/keyboard I downgrade to 4.13.0 and it works But I'd like to use the latest version, it has useful methods and I need disableScroll() How I can replace disableScroll() in 4.15.0?

Xample commented 5 years ago

I am also looking for an alternative. I do now have a glitch when arriving on a page with autofocus (the keyboard opens, covers half of the page and the header is hidden)

abhijithp commented 5 years ago

+1

heidji commented 5 years ago

this function is crucial for iOS. haven't seen any other method stop the unwanted scrolling behavior. downgrading until solved.

mlynch commented 5 years ago

@manucorporat I see disableScroll is in our older deprecated plugin but not this one. Maybe just an oversight? https://github.com/ionic-team/ionic-plugin-keyboard/blob/master/src/ios/IonicKeyboard.m

Thoughts on adding that back in?

lokkeshjaya commented 5 years ago

Hi @mlynch Is there an ETA on when the disableScroll function would be added back to the latest plugin?

collindutter commented 5 years ago

I was able to fix my keyboard resizing issues with this config preference: <preference name="KeyboardResize" value="false" />

Sorry if this is obvious, but somehow I missed this option after hours of searching!

Xample commented 5 years ago

@collindutter it worth giving a try, perhaps I can do the same. I just need to make sure it will work across the whole app

ghost commented 5 years ago

@Xample @mlynch Found a solution?

tribalboy3000 commented 5 years ago

<preference name="KeyboardResize" value="false" />

Does not work

ghost commented 5 years ago

npm install --save @ionic-native/keyboard@4.12.0

GOOOOOOOD

tribalboy3000 commented 5 years ago

This still didn't work for me. 'cordova plugin list' shows: cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard" package.json dependencies show: "@ionic-native/keyboard": "^4.12.0", "cordova-plugin-ionic-keyboard": "2.1.3",

Then in deviceready I tried: Keyboard.disableScroll(true); & cordova.plugins.Keyboard.disableScroll(true);

But when I focus on an input it still scrolls. Am I missing something?

heidji commented 5 years ago

maybe something you missed in the config.xml but this isn't the issue to discuss it at. this bug merely talks about a missing function..

uviekelvin commented 5 years ago

This issue is really frustrating. hoping this get resolves by the ionic team

JrSagas commented 5 years ago

This still didn't work for me. 'cordova plugin list' shows: cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard" package.json dependencies show: "@ionic-native/keyboard": "^4.12.0", "cordova-plugin-ionic-keyboard": "2.1.3",

Then in deviceready I tried: Keyboard.disableScroll(true); & cordova.plugins.Keyboard.disableScroll(true);

But when I focus on an input it still scrolls. Am I missing something?

Hi, did you get a solution? I have the same issue

tmk1991 commented 5 years ago

@mlynch everyone is referring to the @ionic/native wrapper for the keyboard. There was an issue where the wrapper wasn't using this cordova plugin before. See @mhartington 's response: https://github.com/ionic-team/ionic-native/issues/2306#issuecomment-392768387

https://github.com/ionic-team/ionic-native/issues/2743

on the version 4.15.0 of the native wrapper this was corrected but now this cordova plugin doesn't have the disableScroll functionality. https://github.com/ionic-team/ionic-native/blob/master/CHANGELOG.md

floriandorre commented 5 years ago

Any news about this issue ?

ghost commented 5 years ago

npm install --save @ionic-native/keyboard@4.12.0

🤦🏻‍♀️

heikomat commented 5 years ago

I had a problem where the app would automatically scroll to the focused element whenever an element got focused, and there seemed to be no way to prevent this.

Downgrading @ionic-native/keyboard was not an option, because of incompatible rxjs versions.

As it turns out, There is an undocumented (private) configration for the IonicModule called scrollAssist, wich is true by default, but can just be disabled like this in your app.module.ts:

    IonicModule.forRoot({scrollAssist: false}),

Disabling scrollassist made the app no longer auto-scroll to focused elements on iOS. See this SO-answer for some more context.

Heliks commented 5 years ago

You remove functionality that is crucial for some iOS workarounds and then don't even bother to address this issue in almost 9 months? Is this a joke?

nawwa commented 5 years ago

Any progress ?

Kinda solved using :

"cordova-plugin-ionic-keyboard": "^2.1.3" "@ionic-native/keyboard": "^4.20.0"

IonicModule.forRoot(MyApp, { scrollPadding: false, scrollAssist: false, autoFocusAssist: false })

declare const Keyboard: any; Keyboard.hideFormAccessoryBar(true); Keyboard.disableScroll(true);

I say "kinda" because it's still scrolling on textarea.. but that solve 90% of my problems.

desmondcain commented 5 years ago

To fix this for me, the problem was that I had to switch from UIWebView to WKWebView and use cordova-plugin-ionic-keyboard. As noted here: https://github.com/ionic-team/cordova-plugin-ionic-keyboard#cordova-plugin-ionic-keyboard cordova keyboard is meant to work with WKWebView. I stumbled on this after digging around and landing on Max's comment: https://github.com/ionic-team/ionic-plugin-keyboard/issues/305#issuecomment-377813835

Here's the docs for updating webviews: https://ionicframework.com/docs/v3/wkwebview/#

mlynch commented 5 years ago

@Heliks hid your comment as it's abusive and unproductive. Watch your behavior.

We're going to be adding this feature back into either the keyboard plugin or the webview plugin and will provide an update once that is ready.

heidji commented 5 years ago

why is this discussion even happening here? isn't the problem about the ionic-native wrapper or am i missing something?

jcesarmobile commented 5 years ago

@heidji the ionic wrapper was using the old keyboard plugin, which is deprecated. The wrapper now uses this plugin, which doesn't have disableScroll method and people is complaining about it.

heidji commented 5 years ago

@jcesarmobile oh i see it now, it just displays a warning that it was removed :D, sorry I misread the function