Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

257
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda