Skip to content
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

Odd style behaviours when view is shrunk #11

Closed
hellopablo opened this issue Dec 6, 2015 · 9 comments
Closed

Odd style behaviours when view is shrunk #11

hellopablo opened this issue Dec 6, 2015 · 9 comments

Comments

@hellopablo
Copy link

I'm finding odd behaviours when the keyboard is shown on iOS.

I have absolutely and fixed positioned elements, and their positionings go completely off when the keyboard shows. Also, scrolling seems to be disabled, despite setting Keyboard.disableScrollingInShrinkView(false);

Does the plugin do anything beyond simply adjusting the height of the native webview? I'm not really sure where to begin debugging.

Thanks!

@cjpearson
Copy link
Owner

@hellopablo, it looks like your issue is similar to this one. Have you tried setting automaticScrollToTopOnHiding to true?

Keyboard.automaticScrollToTopOnHiding = true;

Also, what does your viewport tag look like?

@hellopablo
Copy link
Author

Thanks, @cjpearson, but unfortunately that didn't help.

Head looks like this:

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0" />
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="mobile-web-app-capable" content="yes">
        <meta charset="utf-8">
        <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
        <meta name="apple-mobile-web-app-title" content="My App" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
        <link rel="stylesheet" href="assets/lib/fontawesome/css/font-awesome.css" />
        <link rel="stylesheet" href="assets/lib/durandal/css/durandal.css" />
        <link rel="stylesheet" href="assets/css/styles.css" />
    </head>
    <body>

@cjpearson
Copy link
Owner

Do you have an example app that shows the issue? I can try and look into it.

@hellopablo
Copy link
Author

Sure do. Will send you the repo link via email. Thanks!

@mluria
Copy link

mluria commented Feb 28, 2016

I'm a bit confused. I was using the iconic keyboard plugin, it did what I needed. I want to switch to wkwebview, and I upgraded to cordova 6.0, and xcode 7.2. I changed my server to enable CORS: Access-Control-Allow-Origin: *, switched from WEBSQL to IndexedDB using localforage, and a few other changes, but I've gotten stuck on issues regarding the keyboard.

I remember there was some bug a couple years ago, that opening the keyboard caused the window to scroll down, and never scroll back up, that's why I was using iconic's disableScroll function, and it seemed to work.

I saw a bug report that these things had been fixed in Telerik-Verified-Plugins/WKWebView, but it seems like the cordova one was more up to date, so I've tried cordova-plugin-wkwebview-engine along with cordova-plugin-keyboard.

In any case, as soon as I open the keyboard, the current window scrolls out of view, and the textinput is no longer visible. As soon as I hit a key, it comes back into view. After the keyboard is closed, the bottom of the screen is now off by about 20 pixels, and never corrects itself. It's a little disconcerting, and may mean, I need to abandon wkwebview, and go back to the old webview.

I've tried various combinations of Keyboard.automaticScrollToTopOnHiding = true; and Keyboard.disableScrollingInShrinkView(true); but to know avail.

The Keyboard.hideFormAccessoryBar(true); does work.

Any ideas?

@cjpearson
Copy link
Owner

Just to clarify cordova-plugin-keyboard and UIWebView works correctly, but cordova-plugin-keyboard combined with cordova-plugin-wkwebview causes this issue?

Do you have a simple example that shows this? Also, which Telerik-Verified-Plugins/WKWebView issue are you referring to?

@mluria
Copy link

mluria commented Mar 2, 2016

Yes. cordova-plugin-keyboard combined with cordova-plugin-wkwebview causes this issue.

Telerik-Verified-Plugins/WKWebView#27

I don't have a simple example, but if you can't reproduce the problem, I could try to put a simple one together.

@cjpearson
Copy link
Owner

I think an example would help. I'm seeing some issues with the scrollview on WKWebView, but not as you describe. If you add self.webView.scrollView.contentInset = UIEdgeInsetsZero; to the top of the scrollViewDidScroll method does it help anything?

@hellopablo
Copy link
Author

Closing abandoned issues / clearing my issues inbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants