malihu / malihu-custom-scrollbar-plugin

Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support etc.
http://manos.malihu.gr/jquery-custom-content-scroller
MIT License
4.11k stars 1.5k forks source link

Cannot read property 'autoUpdate' of undefined #432

Open basvandenheuvel opened 8 years ago

basvandenheuvel commented 8 years ago

Version: 3.1.4. Setup: Webpack + Angular 2.

Whenever i try to call $(element).mCustomScrollbar("destory") i get an error: Cannot read property 'autoUpdate' of undefined.

mjbradford89 commented 7 years ago

+1

JohanBeekers commented 7 years ago

+1

EIZENHORN91 commented 7 years ago

+1 get this issue now in Angular2 + WebPack config. I'm use this with select2 plugin. mCS version - ^3.1.5 (check https://github.com/malihu/malihu-custom-scrollbar-plugin/issues/392 not help) mCSB_container[0] some times is undefined because mCSBcontainer=$("#mCSB"+d.idx+"_container"); return null.

alexsalmon commented 7 years ago

+1

izaruba commented 7 years ago

+1

alxkos commented 7 years ago

+1

izaruba commented 7 years ago

#392 works you should add if(!mCSB_container.length) return; right after

_autoUpdate=function(rem){
    var $this=$(this),d=$this.data(pluginPfx),o=d.opt,
          mCSB_container=$("#mCSB_"+d.idx+"_container");
abhishek10281 commented 7 years ago

I have the same issue . But the pluggin doesn't contain these lines and its version 3.1.5 _autoUpdate=function(rem){ var $this=$(this),d=$this.data(pluginPfx),o=d.opt, mCSB_container=$("#mCSB_"+d.idx+"_container");

rogerburkhard commented 7 years ago

I had to uncomment or delete line 1108:

clearTimeout(mCSB_container[0].onCompleteTimeout); _delete(mCSB_container[0],"onCompleteTimeout");
kundan-kumar1993 commented 6 years ago

I have the same error with lazy load routing of angular, I'v implemented through directive like - <div class="full-fluid border-bonus bonus-list" malihu-scrollbar [scrollbarOptions]="scrollbarOptions"></div> Please let me know if anyone have solution.