Join GitHub today
RangeControl: Fix initialPosition to accept 0 #18611
This update fixes the
Being able to set the value to
How has this been tested?
Tested in Storybook. Added new story specifically for this use case.
Types of changes
This update changes how
This update fixes the `initialPosition` prop for `RangeControl` to properly handle a value of `0`. Previously, the fallback value was checking for truthiness, which does not allow for `0` to work. Being able to set the value to `0` is important with something like a range slider, as you may not have an initial value, but you would like the slider to start from the very beginning (with an example range of 0-20).