react-input-range
react-input-range copied to clipboard
TypeError on ownerDocument for onChangeComplete with re-rendering
Hello. First I would like to thank you for your excelent job. This range component is really good.
The following error is happening when the event 'onChangeComplete' is triggered, at this file.
Uncaught TypeError: Cannot read property 'ownerDocument' of null at InputRange.removeDocumentMouseUpListener at InputRange.handleMouseUp
When I try that event with something simple, like console.log, it does not show the error. It only happens because I'm changing state and redux is rendering my components again.
If it's a ref issue, I would like to know how should I input the ref for the InputRange, so the following error does not happen. The component is working flawlessly, this is the only problem, popping this error in my console.
This is happening on input-range.jsx:309.
Thanks in advance.
Getting same issue. Any known solutions?
Same issue here
As a workaround I had to wrap the event handler in a setTimeout with 100ms of delay.
Whatever you are doing inside onChangeComplete , wrap it with setTimeout function like this:
onChangeComplete={ value => { setTimeout(() => { //function after change complete }, 1000); } }
After adding the setTimeout the error goes away but the slider UI goes back to its original state