Skip to content

Commit

Permalink
Fix marks and simplify tooltip positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
sarayourfriend committed Aug 6, 2021
1 parent ca952f7 commit 1060532
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions packages/components/src/range-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ function RangeControl(
const calculatedFillValue = ( ( value - min ) / ( max - min ) ) * 100;
const fillValue = isValueReset ? 50 : calculatedFillValue;
const fillValueOffset = `${ clamp( fillValue, 0, 100 ) }%`;
const tooltipOffset = `calc( ${ fillValueOffset } - 4px )`;

const classes = classnames( 'components-range-control', className );

Expand Down Expand Up @@ -190,9 +189,6 @@ function RangeControl(
const offsetStyle = {
[ isRTL() ? 'right' : 'left' ]: fillValueOffset,
};
const tooltipOffsetStyle = {
[ isRTL() ? 'right' : 'left' ]: tooltipOffset,
};

return (
<BaseControl
Expand Down Expand Up @@ -262,7 +258,7 @@ function RangeControl(
inputRef={ inputRef }
renderTooltipContent={ renderTooltipContent }
show={ isCurrentlyFocused || showTooltip }
style={ tooltipOffsetStyle }
style={ offsetStyle }
value={ value }
/>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export const ThumbWrapper = styled.span`
user-select: none;
width: ${ thumbSize }px;
border-radius: 50%;
transform: translateX( 4.5px );
${ thumbColor };
${ rtl( { marginLeft: -10 } ) };
Expand Down

0 comments on commit 1060532

Please sign in to comment.