cordova-plugin-keyboard
cordova-plugin-keyboard copied to clipboard
Shrinkview creates empty space
Image: http://puu.sh/n4gOl/1a822edff3.png
As seen on the picture, with shrinkview enabled I am getting a lot of empty space that is not part of my HTML. My view has position absolute and I was using Ionic keyboard previously to shrink my HTML DOM container manually when keyboard was shown. Shrinkview(false) also does not behave as expected as it pushes my webview up instead of having the keyboard overlay it.
Any ideas? Thank you
scrollViewDidScroll never gets called in my case
edit: just realized I have another scrollViewDidScroll initialized in Cordova-Google-Maps which takes over and keyboard event is not fired. Wish I actually knew Objective C/iOS development, but I will keep experimenting.
Both this plugin and the google maps plugin assign themselves as the scrollview delegate with this line
self.webView.scrollView.delegate = self;
There can only be one delegate so the plugin that is initialized second will win. Have you tried removing the google maps plugin?
Thanks for the reply. It does work when removing scrollView.delegate from google maps. For the time being I have modified the google maps plugin as I didn't really need to listen to scrollViewDidScroll for my use case.
From technical perspective - is it even possible to assign custom scrollViewDidScroll per plugin or is calling self.webView.scrollView.delegate = self; at plugin execution times the only option to switch between those? Not really sure about the performance overhead it carries.
The scrollView only calls one scrollViewDidScroll method. I think the only way to make this work is to have some third object that receives scrollViewDidScroll and then calls scrollViewDidScroll on both this plugin and the google maps plugin.
That would require changes to both plugins to register with the manager object instead of attaching themselves as the delegate directly.
I'm having the same issue (when the Keyboard is open, blank space like the screenshot above) with an Ionic 2 project, except this plugin is my only active scrollView delegate. And I noticed if I open or close the little iOS 8-9 3-word autoprediction bar, the empty space goes away.
Any ideas?
exact same to me as @apparition47 said: open/close of that extra bar resizes correctly
Opening and closing that bar triggers a keyboard frame change event which we listen to for resizing the webview. So it makes sense that it could fix the issue. I'm not sure why the issue is occurring though.
Since it's not related to google maps, could one of you open a new issue and add some details? A runnable code sample showing the issue would also be helpful.
I was hoping to provide some example code... but didn't manage to find time building one yet. So, basically it's a setup with some fixed positioned bars, like in http://goratchet.com/ + phonegap 6.2.0
Any updates on this? I'm still having the same issue.
@josiaho I wasn't able to reproduce it. Do you have some sample code that shows the issue?
Thanks for the response! Here you go. There's a scrolling textarea with a fixed position. When it is focused the keyboard comes up but looks like it adds an additional keyboard-height space above it (screenshot). Please let me know what else you need. Thanks so much!
cordova-keyboard-bottom-space.zip
Screenshot:
Has there been any update on this issue? I'm having the same issue as @mashpie.
@josiaho have you had any progress on this issue?
@jsavage86 No unfortunately. Sorry!
@josiaho, are you able to use WKWebView in your application? Adding cordova-plugin-wkwebview-engine to the sample seemed to fix the issue for me.
For me, only elements that are position: fixed are affected by this. Any element that is fixed does not seem to correctly calculate its position.