Disabling the scrollbar within angular elements

Trying to remove the two scrollbars from this code, but so far unsuccessful. Attempted using overflow:hidden without success

filet.component.html

<mat-drawer-container class="example-container" autosize>
    <button type="button" mat-button (click)="drawer.toggle()">
      Filtri
    </button>
    <mat-drawer #drawer class="example-sidenav" mode="side">
          <!-- Sezione taglie -->
          <section class="example-section" [formGroup]="toppings">
            <h4>Seleziona la tua taglia:</h4>
            <p><mat-checkbox formControlName="size_34">34</mat-checkbox></p>
            <p><mat-checkbox formControlName="size_36">36</mat-checkbox></p>
            <p><mat-checkbox formControlName="size_38">38</mat-checkbox></p>

            
          </section>
          <!-- Sezione colori -->
          <section class="example-section" [formGroup]="toppings">
            <h4>Seleziona il colore:</h4>
            <p><mat-checkbox formControlName="nero" id ="nero">Nero</mat-checkbox></p>
            <p><mat-checkbox formControlName="bianco" id ="bianco">Bianco</mat-checkbox></p>
            
          </section>
          <!-- Sezione Marche -->
          <section class="example-section" [formGroup]="toppings">
            <h4>Selezione la marca:</h4>
            <p><mat-checkbox formControlName="Louis">Louis Vuitton</mat-checkbox></p>
           
          </section>
          <!-- Sezione Prezzo -->
          <section class="example-section" [formGroup]="toppings">
            <h4>Selezione il prezzo:</h4>
            <p><mat-checkbox formControlName="price_20">Fino a 20 EUR</mat-checkbox></p>
          
          </section>
          
          
      </mat-drawer>
<!--        -->
    <div class="example-sidenav-content">
    </div>
  
  </mat-drawer-container>
  

filter.component.scss



.example-container {
    width: 500px;
    height: 300px;
    border: 1px solid rgba(0, 0, 0, 0.5);
    

  }
  
  .example-sidenav-content {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center;
   
  }
  
  .example-sidenav {
    padding: 20px;
   
    
  }
  .example-section {
    margin: 12px 0;
    
  }
  
  
  

Struggling to remove the two scrollbars. Attempted using CSS with no luck. Perhaps need to override the angular material component? https://i.sstatic.net/Voqul.png

Answer №1

Success! I found a solution that worked for me.

To make the scrollbars disappear in your styles.css file, add the following code:</p>

.mat-drawer-inner-container::-webkit-scrollbar {
  display: none ;
}

.mat-drawer-content::-webkit-scrollbar{
  display: none ;
}

The first snippet will hide the smaller scrollbar, while the second one will hide the larger scrollbar.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Ways to customize the placeholder for Material input fields in Angular 5

Is it possible to customize the placeholder color in an Angular Material input field? <mat-form-field> <input matInput placeholder="Name"> </mat-form-field> ...

Issues with Angular Material Pagination functionality may be causing unexpected behavior

I'm facing an issue with displaying data in an HTML table using an API. I've tried to implement pagination to show 3 or 6 rows per page, but it's not working as expected. Currently, all the data is being displayed without any pagination, whe ...

External CSS file for Demandware platform

My boss was supposed to train me this year on demandaware knowledge, but ended up quitting, leaving me in the dark. I am scheduled to attend workshops later this year, but for now I am relying on Google and stackoverflow for guidance. Currently, I am wor ...

Create text that alternates between blinking and changing content simultaneously

I'm currently working on a website and I am curious about how to achieve the effect of making text blink and change content simultaneously, similar to what is seen on this particular website . Sorry for not being more specific in my question. Thank yo ...

Styling certain UL and LI elements with CSS properties

Greetings everyone! I constantly struggle when it comes to making my CSS cooperate. I have some code that involves using ul and li tags. However, I only want to apply that styling to specific sections of my HTML code rather than all instances of the ul and ...

What purpose does the asterisk have in CSS?

Similar Question: Understanding the star-preceded property in CSS I recently came across a CSS file for a jQuery script and discovered the following code snippet: .usual div { *margin-top:-15px; clear:left; background:snow; font:10pt Georgia; ...

As the number of lines increases by x%, CSS gradients gradually fade away during the generation process

Is there a way to create a gradient that displays a red line every x% without the colors fading into white? As I add more lines, the red stripes seem to lose their intensity and blend into a white background. The .four-stripes selector creates a good resu ...

Session is not functioning properly as anticipated

import * as express from 'express'; import * as session from 'express-session'; import * as bodyParser from 'body-parser'; const app: express.Express = express(); app.use(bodyParser.json()); app.use(session({ secret: &apos ...

Working with JSON data in Angular 2 constructor

When sending a JSON response from the server, it is in the format shown below: {id: Int, name: String, childJSON: String} I want to map this data to the following TypeScript classes: export class Student{ constructor(public id: string, ...

Is there a way to make a sass file universally accessible without having to import it into every file and causing an increase in bundle size?

Question How can I efficiently import variables.scss globally without the need to duplicate them in every file and reference them in my build instead of importing? Setup I am using Vue2 with laravel-mix, where I have imported index.scss in my main.js ...

The @Input() property within an Angular component is producing an empty array as its result

I have a calendar component that has a data property marked as @Input(): import { Component, OnInit, Input, OnChanges, SimpleChanges } from '@angular/core'; @Component({ selector: 'app-calendar', templateUrl: './calendar.comp ...

An error occurred when attempting to run the command npm run compile:sass, displaying the message: npm ERR! missing script:

Everything seems to be in place with the sass folders and files, so what could be the issue? I have my package.json file set up correctly with the following code: { "name": "starter", "version": "1.0.0", " ...

The variable 'user' is being accessed before being properly initialized - in Angular

I've been doing some research on Google and StackOverflow to try and troubleshoot this error, but I'm still having trouble getting it fixed. Can anyone provide assistance? Below is the content of my auth-service.ts file: import { Injectable } fr ...

Exploring the capabilities of ExcelJS for reading xlsx files within an Angular environment

I'm trying to access a source file, make some changes to it, and then provide it for the user to download. However, I am facing an issue with reading the source file from my project directory. Below is my implementation using excelJS for file reading: ...

Issue with material datepicker not initializing start value when input field is clicked

Using the Material date picker, I've implemented the date picker feature with the startAt binding to establish a default selected value. Users can open the calendar overlay by clicking on the input field, thanks to the (click) and (focus) event bindin ...

Setting the line-height property in CSS to a value greater than the font-size property

Dealing with a frustrating issue where I want to align the top of an image with text, but the letters end up slightly below the line height. Check out this simple example featuring a classic movie: HTML: <img src="http://cf2.imgobject.com/t/p/w92/wcI ...

Is it possible to utilize Webpack 5's ChunkGroup API with several entries?

I am encountering an error message when attempting to upgrade from Webpack 4 to Webpack 5. The error states: Module.entryModule: Multiple entry modules are not supported by the deprecated API (Use the new ChunkGroup API) I have searched for information o ...

My experience with DebugElement in Angular testing has been frustrating due to unexpected behavior

I have been experimenting with integrating test codes into my Angular project. Within the PostFormComponent, there are input bindings and an output event emitter. @Component({ selector: 'app-post-form', templateUrl: './post-form.compon ...

Motion of the atoms

I recently came across an interesting effect on the IconArchive website, but I am unsure how to implement it. If anyone could help me understand the concept with a small example, that would be greatly appreciated. You can see the effect in action by visi ...

How to avoid property sharing in Angular recursive components

I am currently working on a recursive component that generates a tree structure with collapsible functionality. However, I am facing an issue where the state variable active is being shared among child components. Is there a way to prevent this from happen ...