malihu-custom-scrollbar-plugin icon indicating copy to clipboard operation
malihu-custom-scrollbar-plugin copied to clipboard

Cannot read property 'autoUpdate' of undefined

Open basvandenheuvel opened this issue 8 years ago • 10 comments

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.

basvandenheuvel avatar Jul 07 '16 09:07 basvandenheuvel

+1

mjbradford89 avatar Dec 14 '16 20:12 mjbradford89

+1

JohanBeekers avatar Jan 19 '17 10:01 JohanBeekers

+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 mCSB_container=$("#mCSB_"+d.idx+"_container"); return null.

EIZENHORN91 avatar Feb 21 '17 15:02 EIZENHORN91

+1

alexsalmon avatar Mar 20 '17 17:03 alexsalmon

+1

izaruba avatar May 31 '17 15:05 izaruba

+1

alxkos avatar Jun 14 '17 17:06 alxkos

#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");

izaruba avatar Jun 20 '17 11:06 izaruba

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");

abhishek10281 avatar Aug 28 '17 12:08 abhishek10281

I had to uncomment or delete line 1108:

clearTimeout(mCSB_container[0].onCompleteTimeout); _delete(mCSB_container[0],"onCompleteTimeout");

rogerburkhard avatar Nov 02 '17 12:11 rogerburkhard

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.

kundan-kumar1993 avatar May 31 '18 05:05 kundan-kumar1993