Skip to content

Commit

Permalink
fix: add box-shadow to scrollbar when focus
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielS-Qlik committed Apr 24, 2023
1 parent a3fafd2 commit b846634
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apis/nucleus/src/components/listbox/ListBoxInline.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const classes = {
listboxWrapper: `${PREFIX}-listboxWrapper`,
};

const StyledGrid = styled(Grid, { shouldForwardProp: (p) => !['containerPadding'].includes(p) })(
({ theme, containerPadding }) => ({
const StyledGrid = styled(Grid, { shouldForwardProp: (p) => !['containerPadding', 'isGridMode'].includes(p) })(
({ theme, containerPadding, isGridMode }) => ({
backgroundColor: theme.listBox?.backgroundColor ?? theme.palette.background.default,
[`& .${classes.listBoxHeader}`]: {
alignSelf: 'center',
Expand All @@ -49,6 +49,9 @@ const StyledGrid = styled(Grid, { shouldForwardProp: (p) => !['containerPadding'
'&:focus': {
boxShadow: `inset 0 0 0 2px ${theme.palette.custom.focusBorder} !important`,
},
'&:focus ::-webkit-scrollbar-track': {
boxShadow: !isGridMode ? 'inset -2px -2px 0px #3F8AB3' : undefined,
},
'&:focus-visible': {
outline: 'none',
},
Expand Down Expand Up @@ -311,6 +314,7 @@ function ListBoxInline({ options, layout }) {
onMouseEnter={handleOnMouseEnter}
onMouseLeave={handleOnMouseLeave}
ref={containerRef}
isGridMode={isGridMode}
>
{showToolbarWithTitle && (
<Grid
Expand Down

0 comments on commit b846634

Please sign in to comment.