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

180
Views
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 answers
Answer question

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 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!