Closed Mike-Bell closed 5 years ago
I think that better solution would be to provide forceResize()
so that users can create their own logic. The problem is that resizing the slider on each prop change is inefficient. Perhaps the best way is to use ResizeObserver but it's only supported by Chrome at the moment.
So with forceResize()
method users could use the best solution for their case (probably calling that method on each prop change is fine in some situations).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If my slider handles are a dynamic size, they can extend beyond the limits of the slider in some situations.
Here's a concrete (and pretty reasonable / practical) example:
In this example, I display the value of the slider on the handle as it moves (a fairly reasonable thing one might want to do).
But once the slider ticks up to "10", the handle becomes bigger and goes off the slider.
Playing around with the source code, one "solution" I came up with (at least for this particular example) is to always force
_handleResize
incomponentWillReceiveProps
. This could also key off of a prop, likeforceResizeOnPropChange
, so you could allow consumers to opt in to this less efficient behavior.