emberjs / list-view

An incremental rendering list view for Ember.js
MIT License
465 stars 116 forks source link

Scrolling with wheel broken in Firefox #236

Closed jacojoubert closed 9 years ago

jacojoubert commented 9 years ago

You can drag the scrollbar to scroll through list-view, but if you attempt to use the mouse wheel Firefox snaps the scroll location back to the top.

stefanpenner commented 9 years ago

Can you provide an example. Does this affect both virtual and non virtual. Which a versions of ember/list-view does this affect

jacojoubert commented 9 years ago

Yeah seems to be my fault. My bad.

stefanpenner commented 9 years ago

Maybe you can share the cause. So future travelers can solve there issue easiser

jacojoubert commented 9 years ago

So I have spend a bunch of time investigating this and it is related to #229

I am using list-view in a popup and don't want the page to scroll when it runs out of items. So I watch the mousewheel event for the element so I can prevent the default scroll event and do it manually via the scrollTo method on list-view.

In the latest version of list-view some of the internals must have changed such that calling scrollTo in rapid succession causes it to have unexpected behaviour (though on Safari it works just fine). On firefox it scrolls to the top and in Chrome it causes the scroll event to bubble up to the page and scroll it.

I am still looking for a better way to do this. In firefox watching the DOMMouseScroll event and setting cancelBubble to true does what I want. Have not been able to find a simple solution for Chrome.

jacojoubert commented 9 years ago

I will also add that Chrome seems to have a lot worse performance than other browsers so that may be related. Scrolling really fast shows the rows empty for a split second before the label shows up whereas that does not happen in Firefox or Safari.