angular-ui / ui-grid

UI Grid: an Angular Data Grid
http://ui-grid.info
MIT License
5.39k stars 2.47k forks source link

Unable to disable vertical Scroll [since v3.0.0-rc.20-89461bc] #3370

Open jercoh opened 9 years ago

jercoh commented 9 years ago

This commit 89461bc broke the ability to disable vertical scrolling.

Last unstable version (NOT WORKING): http://plnkr.co/edit/k46LqpiBc1cesOP8xdIM?p=preview

Unstable version v3.0.0-rc.20-d4a784f - 2015-04-21 (WORKING): http://plnkr.co/edit/35szFnzVSPGinvzJgR8y?p=preview

Also, the scrolling cannot be disabled if the grid has already been scrolled.

jercoh commented 9 years ago

Hi,

Any update on this issue?

Thanks!

PaulL1 commented 9 years ago

@swalters: is this in your area?

mryellow commented 11 months ago

All I can do is laugh. This (what should have been a) 2 minute job is going to be my life now.

mryellow commented 11 months ago

This solution is good.

Overloading atTop and atBottom so that this preventDefault() codepath is under your control again.

https://github.com/angular-ui/ui-grid/blob/8892f1d178669530a8db19c7a269fd00f88adb85/packages/core/src/js/directives/ui-grid-render-container.js#L106-L112

ScrollEvent.prototype.atTop = function(scrollTop) {
    return true;
};

ScrollEvent.prototype.atBottom = function(scrollTop) {
    return true;
};

https://stackoverflow.com/a/44020606/2438830