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

Scrollwheel not supported #7

Open
agausachs opened this issue Dec 2, 2022 · 0 comments
Open

Scrollwheel not supported #7

agausachs opened this issue Dec 2, 2022 · 0 comments

Comments

@agausachs
Copy link

Hi, thanks for developing this component. We are using it in a old project, and it seems that the "official" scrollwheel patch doesn't work. This is the code on sencha forums to be able to use the mouse scrollwheel when on desktop. It works with the rest of lists and pickers, but not with yours. Do you know how can we solve it? Thanks!!

if (Ext.os.is.Desktop)
{
// Native scrolling in Browser
document.addEventListener('mousewheel', function(e){
var el = e.target;
var offset, scroller, _results;
_results = [];
while (el !== document.body) {
if (el && el.className && el.className.indexOf('x-container') >= 0) {
var cmp = Ext.getCmp(el.id);
if (cmp && typeof cmp.getScrollable == 'function' && cmp.getScrollable()){
var scroller = cmp.getScrollable().getScroller();
if (scroller) {
var offset = {x:0, y: -e.wheelDelta*0.5};
scroller.fireEvent('scrollstart', scroller, scroller.position.x, scroller.position.y, e);
scroller.scrollBy(offset.x, offset.y);
scroller.snapToBoundary();
scroller.fireEvent('scrollend', scroller, scroller.position.x, scroller.position.y-offset.y);
break;
}
}
}
_results.push(el = el.parentNode);
}
return _results;
}, false);
}

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

1 participant