Skip to content

Commit

Permalink
fix: Unexpected scrollbars in Firefox/Safari (#51983)
Browse files Browse the repository at this point in the history
- Use `auto` overflow instead of explicit `scroll` to fix unexpected
  scrollbars in Firefox/Safari in TextSelectCopyMulti component
  • Loading branch information
kiosion authored Feb 12, 2025
1 parent dc1055b commit db06505
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,18 @@ export function TextSelectCopyMulti({
selectElementContent(targetEl as HTMLElement);
}

const isFirefox = window.navigator?.userAgent
?.toLowerCase()
.includes('firefox');

return (
<Box
bg="bgTerminal"
pl={3}
pt={2}
pb={3}
pr={saveContent.save ? 10 : 6}
// pr={2}
borderRadius={2}
minHeight="50px"
// Firefox does not add space for visible scrollbars
// like it does for chrome and safari.
pb={isFirefox ? 3 : 0}
css={{
position: 'relative',
overflow: 'scroll',
overflow: 'auto',
}}
maxHeight={maxHeight}
>
Expand Down Expand Up @@ -174,7 +167,7 @@ const Lines = styled(Box)`
word-break: break-all;
font-size: 12px;
font-family: ${({ theme }) => theme.fonts.mono};
overflow: scroll;
overflow: auto;
line-height: 20px;
color: ${props => props.theme.colors.light};
`;
Expand Down

0 comments on commit db06505

Please sign in to comment.