rangeslider.js icon indicating copy to clipboard operation
rangeslider.js copied to clipboard

this.handleDimension rangeslider - Uncaught TypeError: Cannot read property '0' of undefined

Open sebastienb opened this issue 8 years ago • 11 comments

Getting this error using the latest version of range slider and the basic example

sebastienb avatar Dec 15 '16 20:12 sebastienb

@sebastienb a quick example would be nice to figure out whats goin on...

andreruffert avatar Dec 16 '16 11:12 andreruffert

Yea same here. Not sure how to give an example other than the boilerplate. Here's a stack overflow of the same: http://stackoverflow.com/questions/37825296/rangeslider-js-uncaught-typeerror-cannot-read-property-0-of-undefined

Thanks for putting this out, looks awesome!!

nargetdev avatar Dec 25 '16 05:12 nargetdev

Having a similar problem is that if I initialized rangesilder with polyfill=true, and calling this sequence:

 $('input[type="range"]').attr({min: 100, max: 1000});
 $('input[type="range"]').val(100).change();
 $('input[type="range"]').rangeslider('update', true);

This throws error for me that $handle isn't being set.

chrome version 57.0.2987.133

jtsaich avatar Apr 28 '17 23:04 jtsaich

Same problem here (Cannot read property '0' of undefined), with the latest versions of jQuery and rangeslider, using the boilerplate example from the top of the rangefinder page. No fix in half a year since this thread was opened, and a year since it was mentioned on StackOverflow? :( Is the project dead?

KarenRei avatar Jul 11 '17 00:07 KarenRei

Trying to dig into why the sliders on your website work but your boilerplate doesn't.... the code that underpins the website is nothing at all like the boilerplate (under the "Usage" section) :Þ There's some ' output id="js-output" ' that breaks the slider if it goes missing, a giant section of code at the bottom, etc, etc. It doesn't even resemble the boilerplate. The code examples are equally useless, as they give even less information than the boilerplate.

If you're still around, could you give a minimal full working example that includes everything needed to invoke a slider (Google Chrome 59.0.3071.115), and nothing more?

KarenRei avatar Jul 11 '17 01:07 KarenRei

remove the update call at the end of the example and the destroy call aswell. it should work perfect afterwards. just managed making it work.

DanielNetzer avatar Oct 30 '17 10:10 DanielNetzer

The solution here works for me.

j3soon avatar May 26 '18 18:05 j3soon

Caught the same issue on Android/Chrome. Devices: Galaxy S7 (real device), Galaxy Note 4 (Browserstack).

kkomelin avatar Aug 28 '18 18:08 kkomelin

It seems like I tried to call $('input[type="range"]').rangeslider('update'); before initializing the rangeslider and it caused this error.

kkomelin avatar Aug 29 '18 12:08 kkomelin

@kkomelin Yes, so I have opened a pull request #304 to clarify the usage.

j3soon avatar Aug 29 '18 12:08 j3soon

@j3soon Thanks.

kkomelin avatar Aug 29 '18 12:08 kkomelin