Skip to content

Commit

Permalink
fix(suite): HiddenPlaceholder onHover when not discreet mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemonexe committed Oct 3, 2024
1 parent b790a2c commit fedf275
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/suite/src/components/suite/HiddenPlaceholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ type WrapperProps = {
$intensity: number;
$discreetMode: boolean;
$minWidth?: number;
$disableKeepingWidth?: boolean;
};

const Wrapper = styled.span<WrapperProps>`
Expand All @@ -26,9 +25,8 @@ const Wrapper = styled.span<WrapperProps>`
}
`}
${({ $minWidth, $disableKeepingWidth }: WrapperProps) =>
${({ $minWidth }: WrapperProps) =>
!!$minWidth &&
!$disableKeepingWidth &&
css`
display: inline-block;
min-width: ${$minWidth}px;
Expand Down Expand Up @@ -95,14 +93,15 @@ export const HiddenPlaceholder = ({
setWrapperMinWidth(undefined);
};

const shouldEnforceMinWidth = discreetMode && !disableKeepingWidth;

return (
<Wrapper
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
$discreetMode={discreetMode}
$intensity={enforceIntensity !== undefined ? enforceIntensity : automaticIntensity}
$disableKeepingWidth={disableKeepingWidth}
$minWidth={wrapperMinWidth}
$minWidth={shouldEnforceMinWidth ? wrapperMinWidth : undefined}
className={className}
ref={ref}
data-testid={dataTestId}
Expand Down

0 comments on commit fedf275

Please sign in to comment.