Search code examples
angularscrollbarteradata-covalent

How to remove duplicated scrollbar in Angular Covalent templates?


I am super new to Angular 4. I've onlçy created few projects with AngularJS.

I started using Teradata Covalent Framework to build front-end structure and focus on building the menu content and card lists for a Catalog Web App.

I downloaded this full template in https://stackblitz.com/edit/covalent-dashboard-ynyp1w?file=main.ts which you can see in the image below:

enter image description here

As you can see, the problem is those two scrollbars in the right side of the page. I think that only the inner scroll should exist there because it is not interfering with the gray toolbar.

<td-layout>
  <td-navigation-drawer flex [sidenavTitle]="name" logo="assets:covalent">
    Top level navigation drawer
  </td-navigation-drawer>
  <td-layout-nav [toolbarTitle]="(media.registerQuery('gt-xs') | async) ? 'Dashboard' : ''" logo="assets:covalent" navigationRoute="/">
    <button mat-icon-button td-menu-button tdLayoutToggle>
      <mat-icon>menu</mat-icon>
    </button>
    <div td-toolbar-content>
      Top toolbar
    </div>
    <td-layout-manage-list #manageList>
      <div td-sidenav-content layout="column" layout-fill>
        Inner sidenav listing dashboards
      </div>

      <mat-sidenav-container flex>
        <mat-sidenav #sidenav align="end">
          Right Sidenav
        </mat-sidenav>
        <td-layout-nav>
          <div td-toolbar-content>
            Second toolbar
          </div>

          <div flex layout-gt-sm="row">
            <div flex-gt-sm="50">
              <mat-card>
                ...
              </mat-card>
            </div>
          </div>

        </td-layout-nav>
      </mat-sidenav-container>
    </td-layout-manage-list>
    <td-layout-footer>Footer content</td-layout-footer>
  </td-layout-nav>
</td-layout>

Anyone who already worked with this template or is very good at CSS could tell me how to remove this creep extra scrollbar from the site? And (Bonus) How could I replace those old scrollbar style for those new skinny scrollbars from Facebook?


Solution

  • The problem is that your page content is being wrapped in a <mat-sidenav-container flex> element. You'll want to use the <td-layout-nav> element outside of that.

    I've fixed the page in this stackblitz. A simplified version of the code is below.

    <td-layout>
      <td-navigation-drawer flex [sidenavTitle]="name" logo="assets:covalent">
        Top level navigation drawer
      </td-navigation-drawer>
      <td-layout-nav [toolbarTitle]="(media.registerQuery('gt-xs') | async) ? 'Dashboard' : ''" logo="assets:covalent" navigationRoute="/">
        <button mat-icon-button td-menu-button tdLayoutToggle>
          <mat-icon>menu</mat-icon>
        </button>
        <div td-toolbar-content>
          Top toolbar
        </div>
        <td-layout-manage-list #manageList>
          <div td-sidenav-content layout="column" layout-fill>
            Inner sidenav listing dashboards
          </div>
    
          <td-layout-nav>
            <div td-toolbar-content>
              Second toolbar
            </div>
    
            <mat-sidenav-container flex>
              <mat-sidenav #sidenav align="end">
                Right Sidenav
              </mat-sidenav>
              <div flex layout-gt-sm="row">
                <div flex-gt-sm="50">
                  <mat-card>
                    ...
                  </mat-card>
                </div>
              </div>
    
            </mat-sidenav-container>
          </td-layout-nav>
        </td-layout-manage-list>
        <td-layout-footer>Footer content</td-layout-footer>
      </td-layout-nav>
    </td-layout>