-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support animating webview when keyboard appears #22
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR. This issue has bugged me for a while. I like the approach of letting the user define their own JS animation. The reason I didn't include GLKAnimateWebViewFrame was because the animation may not work for everything. Have you tried using this with WKWebView? |
Yeah, I've spent some time trying to figure out a way that works as well. So far, this has been the closest to a good solution, even though it bugs me that the content seems to freeze while the keyboard animates in. I have not tried it with WKWebView yet. |
Does this enhancement work and will it be accepted. I worked around it by adding a transition animation to by content that closely resembles the native transition (ease in/out). It works fine but it would be better to have it done by this plugin. |
@hjellek did you ever get this to animate with the keyboard onOpen? I've looked into it quite a bit, but never could figure out why the animations are queued on the |
@ajarbol unfortunately, no. I have not checked if there has been any changes in later versions of iOS that could be used either. Should perhaps look into it again, would be nice to get it working properly onOpen as well! |
Any news on a fix for this (using WKWebView)? |
waiting for the solution of the problem... |
@cjpearson @shazron @stevengill @hjellek when could we definitely fix this issue ? Clean keyboard interaction is very important for Cordova ... Thanks again for this plugin, we are close of full ios hack ! Here is an other example : Keyboard open / close creates ugly glitch with our app
|
…s through JS<->Native bridge have correct timing
Sorry for the really late response from my side. My branch has been updated to work with WKWebView now. Here are some crude screenshots from our app running on iPhone 5s (the JS implementation is not optimized whatsoever, basically the demo code from the README) |
Great @hjellek ! Have you tried with An example :
|
ps: if you implement css animation, i could spent 1 hour to make the right bezier animation that fits with the ios' keyboard animation ;) |
I haven't focused too much on the client side of the animation yet. Something along the lines of this completely untested code should work for CSS transitions I think:
|
Ok i'll try it this afternoon ! Otherwise the webview seems to be resized by cordova-plugin-keyboard at the end of the ios keyboard animation. One thought about this :
|
@hjellek, thanks for updating this PR! I like the general approach here. I was hesitant to include a JavaScript solution since it likely would not work for every app. Allowing users to define their own animation function should get around this. Also, the docs are appreciated. |
@Aarbel, regarding your first comment I think the whitespace is either part of the app's view controller or one of the WebView's views. I don't recall which, but I explored it a while ago when I first tackled this bug. https://stackoverflow.com/q/27923648/754604 I think one modification we could make is providing a similar animator function when ShrinkView is disable. Then users could shrink the body or any other element with JavaScript. You could try adding a handler to the |
Fix for issue cjpearson#20
@cjpearson any news for merge ? |
@cjpearson @hjellek any news for this PR ? |
@Aarbel sorry, no news on my end. I have not used this in quite a while now, and am not developing anything with Cordova these days. No idea if this still works, or even is the best solution anymore. |
@hjellek |
@cjpearson do you plan to work on it ? |
@cjpearson @hjellek would be really great to merge this branch, |
Any updates on this? I tested on iOS 14 and it doesn't work. Did I make something wrong and it should work? |
@cjpearson do you think you will maintain this part some day ? |
An attempt to fix #13 for iOS so that animation is possible while the keyboard appears and disappears.
The approach is based on the project https://github.com/glyuck/GLKAnimateWebViewFrame with some modifications, and the only issue for me so far is that it seems like the webview content freezes for most of the time while animating the keyboard in, and then plays the whole animation. When the keyboard animates out the webview content seems to be able to animate as expected.
Comments and suggestions are appreciated.