Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrollbar drag & drop is broken on desktop browsers #59

Open
rjgotten opened this issue Jun 2, 2015 · 9 comments
Open

Scrollbar drag & drop is broken on desktop browsers #59

rjgotten opened this issue Jun 2, 2015 · 9 comments

Comments

@rjgotten
Copy link

rjgotten commented Jun 2, 2015

This is not how you detect and handle touch capability:

var hasTouchEvents = ("ontouchstart" in document.documentElement)

/* ... */ 

if(hasTouchEvents) {
    $viewport.ontouchstart = function(event) { /* ... */ };
} else {
    $thumb.onmousedown = function(event) { /* ... */ };
    $track.onmousedown = function(event) { /* ... */ };
};

The hasTouchEvents boolean value will be true on all desktop browsers that implement the touch event API, like Firefox and Chrome, and have, have-had or may at some time have touch-capable devices hooked up that make the OS report touch support. Those browsers are not necessarily using touch input at the moment at all.

Disjoint branching of event bindings for mouse/touch based on this boolean means anything based on mouseup/mousedown such as the drag & drop behavior, can randomly be completely broken on desktops.

You should rewrite this to use joint mouse/touch interaction support instead.

@goranovs
Copy link

goranovs commented Jun 3, 2015

For me this issue exists only under Firefox (tested with 38.0.1 and 38.0.5). I can scroll with mousewheel but its very slow, like 10 times slower than in Chrome and its impossible to drag or click the scroll "handler".

Chrome (43.0.2357.81 m), Opera (29.0) and IE 11 ( 10 and 9 with "devtools" ) are just fine. I'm using nojquery v2.4.2 - 2015-04-03. OS Windows 7 without touchscreen.

@wieringen
Copy link
Owner

Yes you are right this needs some work.

@programmin1
Copy link

Oddly enough I always see this can't-drag-the-scrollbar bug in Ubuntu-14's Firefox (all versions), no other browsers.

Apparently this is because "ontouchstart" in document.documentElement is true although document.documentElement.ontouchstart is null.

Can this be easily fixed?

@patstuart
Copy link
Contributor

For what it's worth, Chrome browser (i.e., the most popular browser) no longer works for any laptops that support touch events (i.e., the majority of modern personal computers). As far as I'm concerned this entire plugin is broken until this is fixed.

@wieringen
Copy link
Owner

If someone can create a pull request I will merge.

@patstuart
Copy link
Contributor

I will have a fix in the next few days. Thanks for the help!

@programmin1
Copy link

At least for me, the problem was not in the browser but in the kernel - I'm curious if you update your kernel or drivers to the latest supported, do you still have the problem? See https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1477815

@rjgotten
Copy link
Author

rjgotten commented Feb 6, 2016

The problem is in the fact that, like so many other libraries, tinyscrollbar incorrectly assumes the presence of an "ontouchstart" means the user is working from a device that is exclusively touch-based.

The only thing the presence of "ontouchstart" indicates is that the browser supports touch events. It says absolutely nothing about the user's current input method.

@wieringen
Copy link
Owner

Can you guys test the latest version (2.5.0)? It has patstuart's patch and it seems to work on my systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants