jnicol / trackpad-scroll-emulator

A jQuery plugin that emulates OSX trackpad-style scrollbars in any browser or platform.
MIT License
217 stars 44 forks source link

Nasty fix for Firefox OS X not working #11

Open silviomoreto opened 10 years ago

silviomoreto commented 10 years ago

The new version of firefox for mac osx supports the os scroll bar, so this workaround c2be16ead84df6d5894e63bfe753732ba6ecf94e does not work any more.

I am trying to fix this, but if someone already has a fix, please share.

jnicol commented 10 years ago

It still seems to work for me in FF 31 on OS X. In what way does it seem broken in your tests?

silviomoreto commented 10 years ago

The new version of firefox is using the scroll bar from the OS if you are using magic mouse, so the 17 pixels are changing the div width.

To try to solve this I changed this value to 0 pixels. But both scroll bars appear one over the other. I dont know if there would be another way to fix it since ff does not support scroll bar width.

6twenty commented 10 years ago

I'm also seeing that this workaround is broken on OS X (FF 31). The width of .tse-scroll-content is 17px too wide as a result of the hard-coded magic number. Removing the workaround solves the problem (though this does result in double-scrollbars, one on top of the other).

I'm not sure what the best solution is as I haven't experienced first-hand the issue that prompted the workaround in the first place.

6twenty commented 10 years ago

The plugin attempts to emulate the OS X scrollbar -- so it should only target other platforms, right? This would avoid the need for workarounds like this one. It looks like OS X can be sniffed using something like navigator.appVersion.indexOf("Mac") != -1

silviomoreto commented 10 years ago

I kind of disagree @6twenty . I use OS X but with a pen tablet, not the mouse. So my scroll bar is not like the one emulated by the plugin. This can happen for someone that is not using magic mouse as well.

6twenty commented 10 years ago

I don't follow, @silviomoreto - how does using a different device change the scroll bar? The OS renders the scrollbar, so what gets rendered is the same whether you use a magic mouse or not.

jnicol commented 10 years ago

On OS X there is also a setting to always show scrollbars, which displays a permanent scrollbar similar to Windows, so disabling the plugin based on platform isn't an option.

What might be an option is detecting a zero width scrollbar, which would indicate that user is on OS X and has has the scrollbar set to show automatically (which is what the plugin emulates), and disabling the plugin in that circumstance only. That's kind of a bigger conceptual decision though.

In the shorter term I will revisit the FF fix and see what I can do to hide the OS scrollbar without needing to make the content wider, since obviously it's undesirable for the content to be cropped. I might not get to this for a while though, since I'm super busy at work for the next couple of weeks.