ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: Mousewheel scrolling broken on Firefox and Chrome on devices with touch support

Open lewisl9029 opened this issue 11 years ago • 11 comments

Type: bug

Platform: desktop browser

Try scrolling the following pen (taken from the official docs: http://ionicframework.com/docs/api/directive/ionList/) on Firefox (Dev Edition 41.0a2) or Chrome (Stable 44.0.2403.130): http://codepen.io/ionic/pen/JsHjf

In Firefox, scrolling is extremely slow, while in Chrome, it doesn't work at all (can't even drag with the mouse).

lewisl9029 avatar Aug 09 '15 16:08 lewisl9029

Not seeing this at all. Scrolling is working fine in chrome and firefox for me.

mhartington avatar Aug 10 '15 19:08 mhartington

Here's a quick update:

This seems to only happen on devices with touch support. Tried it on my desktop and couldn't repro it. And then tested on 3 different windows tablets/hybrids (including 1 fresh windows 10 install to isolate software conflicts) and all of them exhibit the issue.

lewisl9029 avatar Aug 19 '15 23:08 lewisl9029

Well good thing we're not supporting Windows at the moment :grin:

Currently windows has known issues, but we're waiting a bit on window. Market share is really there ATM and with windows 10 coming out, we're waiting to see how that works.

mhartington avatar Aug 20 '15 16:08 mhartington

Thanks for the quick follow up.

I don't think this issue is limited to Windows though. As a quick test, I connected a mouse to my Android phone and tried to mousewheel scroll in Ionic View's Terms of Service page. Same problem there.

So it looks like mousewheel scrolling might be broken on any Windows or Android device with touch support. Granted, using a mouse with Android is a fairly rare use case, so I'd understand if you guys would rather label this as a Windows issue anyways. =)

lewisl9029 avatar Aug 20 '15 21:08 lewisl9029

+1

OSX's Firefox scrolling is really slow, @mhartington have you tried recently?

OSX: 10.11 Firefox: 42.0

Scroll here:

http://codepen.io/ionic/pen/JsHjf

schoettler avatar Nov 18 '15 21:11 schoettler

@schoettler I had some luck setting overflow-scroll="true" for getting the mousewheel to work in firefox. This will break touch scroll for iOS though so you'll have to set this based on the platform/device being used. You can also set this application wide using $ionicConfigProvider.scrolling.jsScrolling(false). Hope this helps.

jonathanchris avatar Feb 12 '16 20:02 jonathanchris

I have created a decorator to change the wheelDampen to a lower value if the browser is Firefox. It's not a beautiful solution, but it works.

$controllerDecorator.$inject = ['$delegate'];
function $controllerDecorator ($delegate) {

    return function (constructor, locals) {

        if ('$ionicScroll' === constructor && isFirefox) {
            locals.scrollViewOptions.wheelDampen = 0.08;
        }

        return $delegate.apply(null, arguments);
    }
}

My goal was to hook into the mouseWheel event in the ctrl.scrollView object but without success. This way there is no need for browser lookup and the event object can be used to determine if scroll velocity needs to be increased.

ChristiaanScheermeijer avatar Dec 16 '16 09:12 ChristiaanScheermeijer

@ChristiaanScheermeijer I would like to try your solution but I do not fully understand what is decorated from your example? Could you clarify?

Also: Is there an ionic-built-in function for checking whether the browser isFirefox?

qqilihq avatar Jan 22 '17 09:01 qqilihq

@qqilihq the $ionicScroll controller is being altered by using a $controller decorater.

Unfortunately Ionic has no Firefox detection (that I'm aware of).

ChristiaanScheermeijer avatar Jan 22 '17 10:01 ChristiaanScheermeijer

Thank you for your feedback! Got it :)

qqilihq avatar Jan 22 '17 11:01 qqilihq

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 04 '18 14:09 ionitron-bot[bot]