Share Posted June 4, 2014 Hi, I'm using scrollTop on a div and would like the native scroll bar to show on mobile. It does on the desktop and Chrome on Android 4.1.2 but doesn't on iOS 7.1.1 on iPhone 4S in either Safari or Chrome. I have set -webkit-overflow-scrolling:touch in the css but it's not helping. Any ideas? Thanks Link to comment Share on other sites More sharing options...
Share Posted June 4, 2014 Draggable sets the overflowX and overflowY to "hidden" on mobile devices because: There's a bug in some mobile browsers (like Android) that causes scrollTop to get forced back to 0 after it is altered via JS (a total show-stopper for a tool like Draggable) From what I understand, most (if not all) mobile browsers have that default behavior anyway (overflow is hidden). You could manually set the overflowX/overflowY back to "auto" or something AFTER you create your Draggable if you'd like to override that behavior. Like yourElement.style.overflowY = "auto"; 2 Link to comment Share on other sites More sharing options...
Share Posted May 31, 2016 Draggable sets the overflowX and overflowY to "hidden" on mobile devices because: There's a bug in some mobile browsers (like Android) that causes scrollTop to get forced back to 0 after it is altered via JS (a total show-stopper for a tool like Draggable) From what I understand, most (if not all) mobile browsers have that default behavior anyway (overflow is hidden). You could manually set the overflowX/overflowY back to "auto" or something AFTER you create your Draggable if you'd like to override that behavior. Like yourElement.style.overflowY = "auto"; Does this actually work for iOS? Thanks. Link to comment Share on other sites More sharing options...
Share Posted May 31, 2016 Are you saying it doesn't work for you? Do you have a sample (codepen) that shows the issue? Link to comment Share on other sites More sharing options...
Share Posted June 1, 2016 Thanks for the reply Jack! I made a small pen: See the Pen XKJewx by wim67 (@wim67) on CodePen It has a scrollbar on a desktop, not on an iPad. Link to comment Share on other sites More sharing options...
Share Posted June 2, 2016 Oh, right, iOS just doesn't show scrollbars like that. It's an iOS browser thing. I think Apple considered it a waste of visual space for a touch device. 1 Link to comment Share on other sites More sharing options...
Share Posted June 2, 2016 oh, ok, thanks. Link to comment Share on other sites More sharing options...
Share Posted June 2, 2016 I believe Windows 10 does the same thing, but different for desktop, where it won't show scrollbars unless you start scrolling on desktop. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now