iominh / ng-scrollbars

Angular wrapper of Malihu's jQuery Custom Scrollbar
http://iominh.github.io/ng-scrollbars/
MIT License
202 stars 62 forks source link

Page freezes whilst loading scrollbar #58

Open frazerwilson2 opened 7 years ago

frazerwilson2 commented 7 years ago

My angular app has a long loading time (15-20s!) which I identified is caused not by fetching data from API but the scrollbar loading on the page. Until the scrollbar is loaded the page freezes and is unscrollable.

I suspect this could be that as the data is loaded onto the page the scrollbar is resizing each time. The angular events for updateScrollbar do not work, is there another way to dynamically stop the scrollbar then start it when my data loads?

frazerwilson2 commented 7 years ago

I have discovered the issue is caused by this line in the original js file:

return function () { return delegateMethod.apply(contextObject, arguments); }

this command runs 360 times on one page and wont allow user to scroll page until this completes. can anyone shed any light on what this does and a way to prevent it running hundreds of times?

iominh commented 7 years ago

hi @frazerwilson2, ng-scrollbars is just a wrapper around malihu-custom-scrollbar so it's possible the issue you're seeing is documented in that repo: https://github.com/malihu/malihu-custom-scrollbar-plugin

If that issue doesn't occur for the original library then there's something happening in ng-scrollbars that's causing this problem

IanConery commented 6 years ago

So I had a similar issue and found, https://github.com/malihu/malihu-custom-scrollbar-plugin/issues/182 The solution that worked for me was to add the following to the config object

advanced:{ updateOnImageLoad:false }