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

mCSB_container[0] can be undefined sometimes

Open thehappycoder opened this issue 9 years ago • 7 comments

Version 3.1.3

In a few days with new version of mCustomScrollbar I've got 2 errors:

  • Cannot read property 'autoUpdate' of undefined
  • Cannot read property 'onCompleteTimeout' of undefined

It looks like mCSB_container[0] can be undefined sometimes. Can you protect against this?

thehappycoder avatar Jan 26 '16 15:01 thehappycoder

Version 3.1.3

Hi, I am also having the same issue. It happens when the scrollbars are attached to dynamically created dropdown list and you navigate away from the list. the new view will throw this exception: jquery.mCustomScrollbar.js:1915 Uncaught TypeError: Cannot read property 'autoUpdate' of undefined.

I hope that would help to fix the issue.

Peter.

Hi !

Version 3.1.3 The same with chosen select and Malihu... Any solutions with the issue ?

Jérôme

Djey1301 avatar Aug 04 '16 09:08 Djey1301

@Djey1301

Hi,

Can you edit version 3.1.3 jquery.mCustomScrollbar.js and test the code below?

Edit jquery.mCustomScrollbar.js and add the following in a new line after line 1909:

if(!mCSB_container.length) return;

Let me know

malihu avatar Aug 04 '16 21:08 malihu

I had the same issue, and It resolved by your comment.

chris-ryu avatar Sep 01 '16 08:09 chris-ryu

3.1.5 has the same issue

lyon-liao avatar Nov 08 '17 09:11 lyon-liao

My solution is: try{ !!$(domId).data("mCS") && $(".search-tooltip").mCustomScrollbar("destroy"); //Destroy }catch (e){ $(domId).data("mCS",''); //Manual Destroy //console.log(e); }

kylvia avatar Mar 27 '18 07:03 kylvia

@kylvia works for me, thank you~

Spike-Leung avatar Nov 16 '18 08:11 Spike-Leung