-
-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Hi,
A small bug report here,
With the Slider component and a single value.
eg.
<Slider
defaultValue={2}
min={0}
max={4}
step={1}
/>You have a double Thumb focus zone due to this code:
9ui/apps/2x/src/components/ui/slider.tsx
Line 15 in 32ac6db
| const _values = React.useMemo( |
There is no value, the defaultValue is not array so you fallback on the [min, max] part.
After a small ping pong with Gemini AI, it suggests me this instead:
const _values = React.useMemo(() => {
const prop = value ?? defaultValue;
if (Array.isArray(prop)) return prop;
return [prop ?? min];
}, [value, defaultValue, min]);However I'm not sure this is a valid solution (not having max anymore), I'd like your input on this to create a bugfix PR.
Thanks
Metadata
Metadata
Assignees
Labels
No labels