Skip to content

Error while dragging: Cannot read property 'toFixed' of undefined #387

@Tsury

Description

@Tsury

Happens with the latest version of rc-slider, also in the last version of ant-design.
Happens when dragging horizontal slider and keep dragging while getting out of the slider X and Y range.

In this line (createSlider.js):
var nextValue = this.trimAlignValue(this.calcValue(pixelOffset));

pixelOffset is negative, and this.calcValue(pixelOffet) returns NaN.

Uncaught TypeError: Cannot read property 'toFixed' of undefined
    at Object.ensureValuePrecision (utils.js:97)
    at ComponentEnhancer.trimAlignValue (Slider.js:170)
    at ComponentEnhancer.calcValueByPos (createSlider.js:260)
    at ComponentEnhancer.onMove (Slider.js:132)
    at ComponentEnhancer._this.onMouseMove (createSlider.js:153)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions