[SliderUnstyled] TypeError Cannot read property 'getBoundingClientRect' of null #26754
Labels
bug 🐛
Something doesn't work
component: slider
This is the name of the generic UI component, not the React module!
When using controlled sliders, while interacting with them, I continuously get errors on this line:
https://github.com/mui-org/material-ui/blob/2d4d0663ff1ed732e6952705d0e23eda13ae25ea/packages/material-ui-unstyled/src/SliderUnstyled/SliderUnstyled.js#L384
Due to this call:
https://github.com/mui-org/material-ui/blob/2d4d0663ff1ed732e6952705d0e23eda13ae25ea/packages/material-ui-unstyled/src/SliderUnstyled/SliderUnstyled.js#L460
It seems to be related to the slider being unmounted while event callbacks related to the notch being dragged are still triggered, for example in a Tooltip:
https://codesandbox.io/s/unstyledslider-material-demo-forked-7yzjd?file=/demo.js
I hold the notch, slide it three or four times, and suddenly move the cursor away while still holding the notch, forcing the tooltip to close, and after some tries, it throws the error:
The text was updated successfully, but these errors were encountered: