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

171
Vistas
Focus next input when pressing Tab in Angular

I have multiple editable inputs on my screen .

Between theses editable inputs I have buttons and disabled inputs.

The actual behavior is when I press Tab the html elements between the current input and next one get focused. I should so press Tab until I get to my sibling Input.

This behavior is not what I want.

What I'm expecting is that when I press Tab the next desired Input get Focused.

Here a simplified code

    <ng-container #form *ngFor="let elm of elms; let currIndex = index" cdkTrapFocus
        [cdkTrapFocusAutoCapture]="true">
      <app-item [index]="currIndex">
    Here I get a line with : span, disabled input , editable input then a button
      </app-item>
    </ng-container>

I tried to use a directive that focus next sibling depending on it's not working due to complex nested html elements inside app-item.

I would like to know if there is a much simpler solution using Angular CDK and "tag" desired items to focus using tab key ?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can dynamically add tabindex="-1" attribute to input element, and when you click tab key, that element will be skipped.

So on each button and disabled inputs, just add tabindex="-1" attribute.

<input tabindex="-1" />
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