Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

255
Views
How to scroll mat-select option top after closing the mat-select?

How to scroll mat-select option top after closing the mat-select?

I have many option in my mat-select. I select one option from bottom. Now, after open mat-select again, I want the list from top.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You have to subscribe to openChange event and reset scroll position of the scrollable element every time MatSelect opens:

@ViewChild('selectElement') selectElement: MatSelect;

ngOnInit() {
  this.selectElement.openedChange.subscribe((isOpen: boolean) => {
    if (isOpen) {
      const panel = this.selectElement.panel.nativeElement as HTMLDivElement;
      panel.scrollTop = 0;
    }
  });
}

Example on StackBlitz.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!