0

I need to disable the bouncy page-level scroll for iOS while preserving the ability to scroll inside a div. The solution to the most popular StackOverflow question on the matter seemed to work for me at first, but I found that with certain positions/transforms, the solution would break.

If I disable -webkit-overflow-scrolling, it works fine, but the user experience without it is greatly diminished in my opinion.

I am using THREE.js's CSS3DRenderer to do the positioning because in the project this is for, I need to composite the dom element on top of a 3D scene and have the cameras match. But essentially, its just adjusting the transforms and nothing more.

I created a CodePen that shows clearly that camera/object position consistently scrolls while blocking page scrolling and another breaks it.

http://codepen.io/aaronmeyers/pen/LKgsG/ please see codepen

Community
  • 1
  • 1
  • Definitely looks like a Safari bug? The codepen is a bit confusing though... when it says "current: broken" seems to work fine, but when it says "current: not broken" the scrolling in the div seems to work erratically. Is that correct? – mrdoob Sep 01 '14 at 21:37
  • Does [this stackoverflow answer](http://stackoverflow.com/questions/19909533/disable-rubber-band-in-ios-full-screen-web-app/21379058#21379058) help? – WestLangley Sep 01 '14 at 21:51
  • @WestLangley It was a bit hard to understand at first, but I think what Aaron is after is keeping the bouncy scroll behaviour in a div but not have it in the document. Seems like there is a bug in the browser itself which breaks the behaviour when there is some transform3d stuff. – mrdoob Sep 01 '14 at 21:55
  • @mrdoob weird. when its "broken", scrolling in the div sometimes works but most of the time it scrolls the whole page instead. for "not broken", it seems to work fine most of the time, though there does seem to be some weirdness even with that. – Aaron Meyers Sep 01 '14 at 22:06
  • @AaronMeyers Have you tried on iOS7? – mrdoob Sep 02 '14 at 17:32
  • @mrdoob i don't have any devices with iOS 7 installed right now, but had someone confirm for me that the problem exists over there (on an iPad running 7.1) – Aaron Meyers Sep 03 '14 at 18:28

0 Answers0