1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

How to stop TAB key event from firing when a modal is open

Discussão em 'Angular' iniciado por matchi, Junho 4, 2025.

  1. matchi

    matchi Guest

    When the modal is showing, how can I disable key events like TAB? I have multiple buttons and fields in a form on the page that can be selected (focused) by tabbing. I want to disable that when the modal is showing. The application uses Angular and the modal is in a child component.

    <button tabindex="0">Button1</button>
    <button tabindex="0">Button2</button>
    <form>...</form>

    <div id="myModal" class="modal fade" role="dialog">
    <div class="modal-dialog">
    <div class="modal-content">...</div>
    </div>
    </div>

    Continue reading...

Compartilhe esta Página