ptomasroos / react-native-multi-slider

Android and iOS Pure JS react native multi slider
MIT License
775 stars 401 forks source link

max value #281

Closed sandeep855 closed 7 months ago

sandeep855 commented 1 year ago

if you pass a value in max greater than 6 digits eg: max={9999999} It hangs your device to load this value. Sometimes crashes the app.

sheralim012 commented 1 year ago

https://github.com/ptomasroos/react-native-multi-slider/blob/7919a26fbda0a7aed00f25409b6dac81e8cac457/converters.js#L84-L86

For very large min & max and very small step, above loop generates very large array which causes the crash. Better to dynamically use the step value like

step = Math.round(Math.abs(max - min) / 100)

This will force the loop to execute only 100 times.

Hope this helps.

ptomasroos commented 7 months ago

Thanks! Added to the readme @sheralim012