html – Mat-tree horizontal scrolling. How to add it?-ThrowExceptions

Exception or error:

I have problems with horizontal scrolling. My mat-tree implementation is from here. Vertical scrolling works perfectly but horizontal doesn’t work. How to add it to my mat-tree? By using an overflow parameter I see the horizontal scrolling bar but it doesn’t work, doesn’t react to content and it is still disabled.

<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
  <mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding>
    <button mat-icon-button disabled></button>
  <mat-tree-node *matTreeNodeDef="let node; when: hasChild" matTreeNodePadding>
    <button mat-icon-button
            [attr.aria-label]="'toggle ' + node.filename" matTreeNodeToggle>
      <mat-icon class="mat-icon-rtl-mirror">
        {{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
    <mat-progress-bar *ngIf="node.isLoading"
.example-tree-progress-bar {
  margin-left: 30px;
How to solve:

works for me with, should be because of max-width=20% it sets on wrapping div:

  <div fxFlex="1 1 20%" fxLayout="row" style="overflow: scroll">
      <mat-tree fxFlex="0 0 auto" ...>


have you tried adding a class to the child mat-tree-node with the style overflow:visible!important .
Here is the complete class to be added btw.

.tree-node {
   margin: 0; 
   padding: 0;
   padding-right: 1%; 
   list-style: none; 
   border: none; 
   overflow: visible !important; /* notice here*/ 

Leave a Reply

Your email address will not be published. Required fields are marked *