Skip to content

Commit 892aa6b

Browse files
authored
Merge pull request #1173 from ARYANSHAH1567/aryanshah/fix_hover_width
Fixed width on hover of MenuItem
2 parents 117f359 + 89c7a75 commit 892aa6b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/custom/ResponsiveDataTable.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { TooltipIcon } from './TooltipIconButton';
1111
export const IconWrapper = styled('div', {
1212
shouldForwardProp: (prop) => prop !== 'disabled'
1313
})<{ disabled?: boolean }>(({ disabled = false }) => ({
14-
width: 'fit-content',
14+
width: '100%',
1515
cursor: disabled ? 'not-allowed' : 'pointer',
1616
opacity: disabled ? '0.5' : '1',
1717
display: 'flex',
@@ -72,7 +72,10 @@ export const DataTableEllipsisMenu: React.FC<{
7272
<MenuItem
7373
key={`${index}-menuitem`}
7474
sx={{
75-
width: '-webkit-fill-available'
75+
width: '100%',
76+
'&:hover' : {
77+
backgroundColor: theme.palette.action.hover
78+
}
7679
}}
7780
onClick={() => handleActionClick(action)}
7881
disabled={action.disabled}
@@ -97,9 +100,12 @@ export const DataTableEllipsisMenu: React.FC<{
97100
return (
98101
<IconWrapper key={index} disabled={action.disabled}>
99102
<MenuItem
100-
sx={{
101-
width: '-webkit-fill-available'
102-
}}
103+
sx={{
104+
width: '100%',
105+
'&:hover' : {
106+
backgroundColor: theme.palette.action.hover
107+
}
108+
}}
103109
onClick={() => handleActionClick(action)}
104110
disabled={action.disabled}
105111
>

0 commit comments

Comments
 (0)