Allow zero as input slider min/max (#854)

This commit is contained in:
bymyself
2024-09-16 17:43:32 -07:00
committed by GitHub
parent 980dd285ad
commit c510b344af

View File

@@ -54,8 +54,8 @@ const updateValue = (newValue: number | null) => {
newValue = Number(props.min) || 0
}
const min = Number(props.min) || Number.NEGATIVE_INFINITY
const max = Number(props.max) || Number.POSITIVE_INFINITY
const min = Number(props.min ?? Number.NEGATIVE_INFINITY)
const max = Number(props.max ?? Number.POSITIVE_INFINITY)
const step = Number(props.step) || 1
// Ensure the value is within the allowed range