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

Commit

Permalink
Only renders modal when visible
Browse files Browse the repository at this point in the history
  • Loading branch information
mathewmorris committed Jan 8, 2020
1 parent 1eecf79 commit 28d3eb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function Modal({ children, title, animationDuration, showClose, onClose,
return (
<ModalContext.Provider value={{ handleClose }}>
<Portal>
<Transition in={isOpen} timeout={animationDuration} onEntering={scrollToTop}>
<Transition in={isOpen} timeout={animationDuration} onEntering={scrollToTop} mountOnEnter unmountOnExit appear>
{state => (
<FocusOn onEscapeKey={handleClose} enabled={isOpen}>
<Backdrop ref={modalRef} transitionState={state} onClick={handleBackdropClick}>
Expand Down

0 comments on commit 28d3eb4

Please sign in to comment.