From 16d17f9824dfac7e55e3ca98444f9da3205c0336 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Tue, 6 Aug 2013 13:59:33 +0300 Subject: Fix native scrolling regression in iOS 6 homescreen apps (#12295) Change-Id: Ie225663ebc2a9ffe4b481a49e34e9dcf79b064b2 --- WebContent/VAADIN/themes/base/common/common.scss | 4 ++-- client/src/com/vaadin/client/BrowserInfo.java | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/WebContent/VAADIN/themes/base/common/common.scss b/WebContent/VAADIN/themes/base/common/common.scss index c32116cda8..cb3645c9d8 100644 --- a/WebContent/VAADIN/themes/base/common/common.scss +++ b/WebContent/VAADIN/themes/base/common/common.scss @@ -228,8 +228,8 @@ input::-ms-clear { line-height: normal; } -/* Enable kinetic scrolling on Mobile Safari 6 */ -.v-ios.v-sa6 & .v-scrollable { +/* Enable kinetic scrolling on iOS 6 */ +.v-ios6.v-webkit & .v-scrollable { -webkit-overflow-scrolling: touch; } diff --git a/client/src/com/vaadin/client/BrowserInfo.java b/client/src/com/vaadin/client/BrowserInfo.java index c733f38481..5d588f6f8b 100644 --- a/client/src/com/vaadin/client/BrowserInfo.java +++ b/client/src/com/vaadin/client/BrowserInfo.java @@ -190,7 +190,7 @@ public class BrowserInfo { } String osClass = getOperatingSystemClass(); if (osClass != null) { - cssClass = cssClass + " " + prefix + osClass; + cssClass = cssClass + " " + osClass; } if (isTouchDevice()) { cssClass = cssClass + " " + prefix + UI_TOUCH; @@ -201,16 +201,22 @@ public class BrowserInfo { } private String getOperatingSystemClass() { + String prefix = "v-"; + if (browserDetails.isAndroid()) { - return OS_ANDROID; + return prefix + OS_ANDROID; } else if (browserDetails.isIOS()) { - return OS_IOS; + String iosClass = prefix + OS_IOS; + if (isIOS6()) { + iosClass += " " + prefix + OS_IOS + "6"; + } + return iosClass; } else if (browserDetails.isWindows()) { - return OS_WINDOWS; + return prefix + OS_WINDOWS; } else if (browserDetails.isLinux()) { - return OS_LINUX; + return prefix + OS_LINUX; } else if (browserDetails.isMacOSX()) { - return OS_MACOSX; + return prefix + OS_MACOSX; } // Unknown OS return null; -- cgit v1.2.3