Skip to content

Commit

Permalink
fix(Modal): fix exception in focus management (#1382)
Browse files Browse the repository at this point in the history
* Fixes 'TypeError: t[(n - 1)] is undefined at [...].handleTab' JavaScript exception
  • Loading branch information
timashev authored and TheSharpieOne committed Jan 30, 2019
1 parent 32eb8ed commit 5cc9af5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Modal.js
Expand Up @@ -214,6 +214,7 @@ class Modal extends React.Component {

const focusableChildren = this.getFocusableChildren();
const totalFocusable = focusableChildren.length;
if (totalFocusable === 0) return;
const currentFocus = this.getFocusedChild();

let focusedIndex = 0;
Expand Down

0 comments on commit 5cc9af5

Please sign in to comment.