fix: add box-shadow to scrollbar when focus (#1234)

This commit is contained in:
Daniel Sjöstrand
2023-04-24 14:08:21 +02:00
committed by GitHub
parent 564336231a
commit 0cea2be537

View File

@@ -31,8 +31,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',
@@ -50,6 +50,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',
},
@@ -326,6 +329,7 @@ function ListBoxInline({ options, layout }) {
containerRef.current = el;
containerRectRef(el);
}}
isGridMode={isGridMode}
>
{showToolbarWithTitle && (
<Grid