Skip to content

Commit

Permalink
Merge pull request #13 from dkrnl/master
Browse files Browse the repository at this point in the history
Uncaught TypeError: Cannot read property 'style' of null
  • Loading branch information
francoischalifour committed Sep 17, 2017
2 parents 833194c + ea81dd7 commit 3f795b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/medium-zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ const mediumZoom = (selector, {
target.dispatchEvent(event)

setTimeout(() => {
if (!target) return

isAnimating = true
document.body.classList.remove('medium-zoom--open')
target.style.transform = 'none'
Expand Down

0 comments on commit 3f795b4

Please sign in to comment.