title: How to get rid of horizontal scrollbar in Material-UI TreeView?
body: <p>When trying out the Material-UI basic example for Tree View (@mui/lab/TreeView), I do not know how to remove the horizontal scrollbar when using the <code>overflowY: &quot;auto&quot;</code> (The same effect even if I use <code>overflow: &quot;auto&quot;</code>) option in the <code>sx</code> prop of the <code>TreeView</code> component. The horizontal scrollbar appears no matter how much space is available to the right. I want to keep the <code>overflowY</code> option in case of vertical overflow.</p>
  <p><a href="https://i.stack.imgur.com/h4RxM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h4RxM.png" alt="enter image description here" /></a></p>
  <p>For example please see the basic tree view example from the official <a href="https://mui.com/material-ui/react-tree-view/#main-content" rel="nofollow noreferrer">Material-UI page</a> in StackBlitz or CodeSandbox.</p>
  <p>How to remove the horizontal scrollbar when it's not needed?</p>