Bird
0
0

What happens when a user presses the 'Tab' key on an element with tabindex="-1" in Angular?

medium📝 component behavior Q4 of 15
Angular - Internationalization and Accessibility
What happens when a user presses the 'Tab' key on an element with tabindex="-1" in Angular?
AThe element receives focus normally.
BThe element is skipped in keyboard navigation.
CThe element triggers a click event.
DThe page reloads.
Step-by-Step Solution
Solution:
  1. Step 1: Understand tabindex="-1" behavior

    tabindex="-1" removes the element from the tab order, so it cannot be focused by Tab key.
  2. Step 2: Confirm Angular behavior

    Angular respects tabindex values, so element is skipped during keyboard navigation.
  3. Final Answer:

    The element is skipped in keyboard navigation. -> Option B
  4. Quick Check:

    tabindex -1 skips focus = A [OK]
Quick Trick: tabindex="-1" means no tab focus [OK]
Common Mistakes:
  • Thinking element still gets focus
  • Assuming click event triggers
  • Confusing with page reload

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes