Skip to content

Commit

Permalink
fix(slider): inverted slider thumb in the wrong position (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
winjeysong committed Jun 29, 2024
1 parent 35f3988 commit 0aa405c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/core/src/slider/slider-thumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ export function SliderThumb<T extends ValidComponent = "span">(
return isVertical ? `translate(-50%, ${value}%)` : `translate(${value}%, -50%)`;
*/

return context.state.orientation() === "vertical"
? "translateY(50%)"
: "translateX(-50%)";
if (context.state.orientation() === 'vertical') {
return context.inverted() ? 'translateY(-50%)' :'translateY(50%)';
}

return context.inverted() ? 'translateX(50%)' : 'translateX(-50%)';
};

let startPosition = 0;
Expand Down

0 comments on commit 0aa405c

Please sign in to comment.