prime.js
prime.js copied to clipboard
Fix tab index handling for modal dialogs
When a modal dialog is open the tab index still will progress through elements behind the overlay.
Here is a good summary of the issue.
https://stackoverflow.com/questions/14572084/keep-tabbing-within-modal-pane-only
A simple fix is to capture the tab key and then manually move focus to the first element in the dialog before the tab index moves focus out of the dialog.
The better solution may to be to use what was suggested in the above SO article which is to set aria-disabled on everything that isn't currently active above the overlay.