Opened 16 months ago

#15240 new bug

Slider: Step with precision > 20 causes RangerError toFixed

Reported by: Edvard Falkskär 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

Change History (0)

Note: See TracTickets for help on using tickets.