Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-webkit-overflow-scrolling:touch and 'Tap status bar to scroll to top'

Navigate to this fiddle on an iPhone and notice that even though there is a -webkit-overflow-scrolling:touch declaration, the 'tap to top' feature still works. This was tested on an iPhone 4 running iOS 6.1 and an iPhone 4S running iOS 5.0.1.

This test raises the question: does declaring -webkit-overflow-scrolling:touch affect the 'tap status bar to scroll to top' behaviour in iOS?

like image 321
Bryce Avatar asked Feb 14 '13 04:02

Bryce


People also ask

How do you scroll to the top on Android?

When you're at the bottom of a page, just tap the left side of your status bar to instantly scroll back up to the top. Tap the right trigger area, and you'll be taken directly to the bottom of any page.

What is ContentInsetAdjustmentBehavior?

Discussion. This property specifies how the safe area insets are used to modify the content area of the scroll view. The default value of this property is UIScrollView. ContentInsetAdjustmentBehavior. automatic .


2 Answers

If you put -webkit-overflow-scrolling:touch on any element other than document.body, it will break the default tap status bar to scroll to top behaviour.

There is a tiny script on GitHub, that works as a replacement for the missing scroll to top of iOS overflow scrolling. You can put it on your apps header to achieve nearly the same result.

like image 146
Patrick Rudolph Avatar answered Sep 30 '22 18:09

Patrick Rudolph


From my experience, it indeed affects it. I don't know of a way to have both features working at the same time, at least as of iOS 6.1.

I also have a quote from the jQuery Mobile docs that backs this up:

The -webkit-overflow-scrolling:touch property seems to disable the events to scroll you to the top of the page when the time is tapped in the status bar. We hope Apple fixes this because it's a very useful feature.

It is really unfortunate that Apple has it set up like this, as I too would love to use this feature, but the scroll-to-top ability is more important to me.

like image 25
Jacob Pritchett Avatar answered Sep 30 '22 17:09

Jacob Pritchett