Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into infra/test-vite
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Jan 3, 2025
2 parents 947ca62 + 58434ca commit 411fbad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react/src/slider/indicator/useSliderIndicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import type { useSliderRoot } from '../root/useSliderRoot';
function getRangeStyles(orientation: useSliderRoot.Orientation, offset: number, leap: number) {
if (orientation === 'vertical') {
return {
position: 'relative',
bottom: `${offset}%`,
height: `${leap}%`,
width: 'inherit',
};
}

return {
position: 'relative',
insetInlineStart: `${offset}%`,
width: `${leap}%`,
height: 'inherit',
Expand All @@ -36,12 +38,14 @@ export function useSliderIndicator(
internalStyles = getRangeStyles(orientation, trackOffset, trackLeap);
} else if (orientation === 'vertical') {
internalStyles = {
position: 'relative',
bottom: 0,
height: `${percentageValues[0]}%`,
width: 'inherit',
};
} else {
internalStyles = {
position: 'relative',
insetInlineStart: 0,
width: `${percentageValues[0]}%`,
height: 'inherit',
Expand Down

0 comments on commit 411fbad

Please sign in to comment.