Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fixed] check if focusLaterElements is empty before popping
Without a check to see if the focusLaterElements array is empty, we end up calling `pop()` on an empty array—resulting in an undefined value—and inadvertently jump to the `catch` block when we attempt to call `focus()` on `undefined`. This ensures that if there are no existing elements to return focus to once our modal is closed (this happens often in a testing env), we do not throw a TypeError by accident.
- Loading branch information