Question · JavaScript and React course · Module 8: Advanced React Patterns

Focus Management in a Modal

What does "focus trap" mean in the context of React modal accessibility?

Answer options

  • Keyboard focus cannot leave the modal, Tab cyclically returns to the first element
  • The modal automatically closes after 5 seconds of inactivity
  • The browser blocks the keyboard when a modal is open
  • Focus trap is a decorator that adds event listeners to every DOM element

You can check the correct answer by solving this task in the CodeWorlds game.