Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
fix(rdmd): don't set scrollTop if el is undefined (#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafegoldberg authored Jun 12, 2020
1 parent ea7f9f5 commit fc804bd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/markdown/components/Image/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ class Image extends React.Component {

lightboxSetup() {
const $el = this.lightbox.current;
setTimeout(() => {
$el.scrollTop = ($el.scrollHeight - $el.offsetHeight) / 2;
}, 0);
if ($el)
setTimeout(() => {
$el.scrollTop = ($el.scrollHeight - $el.offsetHeight) / 2;
}, 0);
}

handleKey(e) {
Expand Down

0 comments on commit fc804bd

Please sign in to comment.