Skip to main content

Search and Top Navigation

#15240 new bug ()

Opened September 21, 2017 11:38AM UTC

Last modified September 21, 2017 11:38AM UTC

Slider: Step with precision > 20 causes RangerError toFixed

Reported by: edvard-falkskar Owned by:
Priority: minor Milestone: none
Component: ui.slider Version: 1.12.1
Keywords: Cc:
Blocked by: Blocking:
Description

When creating a slider with a step option that have a precision greater than 20 digits it will crash. This happens because the precision of the step value is used in Number.toFixed() which will only handle precision between 0 and 20.

I think it would make sense to handle this gracefully and cap the precision to 20 digits.

I created a very simple example on CodePen https://codepen.io/edvard-erlandsson/pen/eGzMZJ that crashes directly.

However in Firefox the maximum precision seems to be 100 instead of 20 like in the other browsers, not sure if it's possible to detect that in a god way though.

Reproduced in

Chrome 61.0.3163.91 on Windows 10 Enterprise

Microsoft Edge 40.15063.0.0 on Windows 10 Enterprise

Internet Explorer 11.608.15063.0 on Windows 10 Enterprise

Attachments (0)
Change History (0)