HI,I am using ng2-bs3-modal@^0.13.0 modal component in one of our projects.
Our requirement is to trap the focus inside the modal however the focus is moving outside of the modal on tabbing. It then stays outside the modal until it traverses all the tabs on the page.
Is there a way you could keep the focus trapped inside the modal until the modal is closed? Or in other words it should continue looping with focus being within the modal.
Expected behavior – Focus should be trapped inside the modal window and on closing it focus should move to the element which triggers the modal window.
This is critical interaction for AX users. Appreciate any support you can provide with regards to this.
Link to my library: (
https://github.com/dougludlow/ng2-bs3-modal)
Example code:
<button type="button" class="btn btn-default" (click)="modal.open()">Open me!</button>
<bs-modal #modal>
<bs-modal-header [showDismiss]="true">
<h4 class="modal-title">I'm a modal!</h4>
</bs-modal-header>
<bs-modal-body>
Hello World!
</bs-modal-body>
<bs-modal-footer [showDefaultButtons]="true"></bs-modal-footer>
</bs-modal>