Skip to content

Commit

Permalink
[TreeView] Fix box-sizing dependency (#10255)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Sep 11, 2023
1 parent dfa06c7 commit a071e54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/x-tree-view/src/TreeItem/TreeItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const StyledTreeItemContent = styled(TreeItemContent, {
})<{ ownerState: TreeItemOwnerState }>(({ theme }) => ({
padding: '0 8px',
width: '100%',
boxSizing: 'border-box', // prevent width + padding to overflow
display: 'flex',
alignItems: 'center',
cursor: 'pointer',
Expand Down Expand Up @@ -116,10 +117,11 @@ const StyledTreeItemContent = styled(TreeItemContent, {
},
},
[`& .${treeItemClasses.label}`]: {
paddingLeft: 4,
width: '100%',
boxSizing: 'border-box', // prevent width + padding to overflow
// fixes overflow - see https://github.com/mui/material-ui/issues/27372
minWidth: 0,
paddingLeft: 4,
position: 'relative',
...theme.typography.body1,
},
Expand Down

0 comments on commit a071e54

Please sign in to comment.