max-mapper / flavors

mobile site to help look up flavor pairings
http://maxogden.github.io/flavors/
25 stars 8 forks source link

Fixes the scroll issue on oldroid #4

Closed piatra closed 11 years ago

piatra commented 11 years ago

Problem is that Android 2.x does not have a proper implementation of the overflow property. Something like overflow auto, scroll or pretty much anything is interpreted as overflow hidden (which is the worst possible interpretation).

This might be a fix http://filamentgroup.github.io/Overthrow/

Removing that line makes the scrolling work but it might break other functionality.

P.S. I have a device running 2.2 I could help out with testing :)

soldair commented 11 years ago

Ha. nice one.

max-mapper commented 11 years ago

on newer browsers this makes it so the sidebar isn't fixed when you scroll, maybe I can use JS to detect android 2.x and swap the styles so it doesnt affect the nice browsers

max-mapper commented 11 years ago

@soldair @piatra can you test to see if this fixes it? https://github.com/maxogden/flavors/commit/6af5e6cf1c8f187ac634a30a6c87c4a05e673810

I've actually dealt with this same issue at least twice before... but I never can figure out a way to solve it trivially.. android browser makes me sad :(

https://github.com/maker/ratchet/pull/97 https://github.com/maxogden/ViewKit/commit/dce920c546a664a901b85b07fb3561d321607656

soldair commented 11 years ago

works great! so many things go with garlic you know?

piatra commented 11 years ago

The way I dealt with it was that I first detected the if it's indeed a 2.x and added a CSS class selector like .no-scroll and afterwards tried to solve everything by using CSS only. Stuff like

.no-scroll .container { overflow: visible }
.scroll .container { overflow: scroll }

Usually things are solvable without JS after you make the detection. Fixed headers are also a huge pain. From what I've tried out a fixed navbar usually lags behind.

Good news is that scrolling can be quite smooth on the default browser and things like faking a translateZ of 0 usually makes things smoother. http://caniuse.com/ has never been more helpful than when developing for android :)