Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
fix(Modal): fix NPE at onTransitionEnd (#2141)
Browse files Browse the repository at this point in the history
Caused by `onTransitionEnd` on a child element in modal, presumably
when modal node ref hasn't been ready yet.

Fixes #2140.
  • Loading branch information
asudoh committed Apr 4, 2019
1 parent 1212dfd commit 09c248a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ export default class Modal extends Component {

handleTransitionEnd = evt => {
if (
evt.target === evt.currentTarget && // Not to handle `onTransitionEnd` on child DOM nodes
this.outerModal.current &&
this.outerModal.current.offsetWidth &&
this.outerModal.current.offsetHeight &&
this.beingOpen
Expand Down

0 comments on commit 09c248a

Please sign in to comment.