react-simple-range
react-simple-range copied to clipboard
Cannot read properties of null (reading 'getBoundingClientRect')
Cannot read properties of null (reading 'getBoundingClientRect')
I think this happens if the the element is not ready in getSliderInfo()
quick fix:
var getSliderInfo = function getSliderInfo() {
var sl = sliderRef.current;
// --------------------------------
if(!sl) return null // fix issue if sliderRef isn't yet registered with the element
//----------------------------------
...
then we need to ignore the info if it's null from above
var updateSliderValue = function updateSliderValue(event, eventType) {
...
...
// --------------------------------
var info = getSliderInfo();
if(!info) return
// --------------------------------
...