Skip to content

Commit

Permalink
Merge pull request #288 from justisb/null-list-ref
Browse files Browse the repository at this point in the history
Handle undefined item list ref
  • Loading branch information
leandrowd authored Dec 14, 2018
2 parents 9ded7e8 + 0b7b00c commit 987c6c2
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/components/Thumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,18 @@ class Thumbs extends Component {
const position = currentPosition + (100 / (wrapperSize / deltaX)) + '%';

// if 3d isn't available we will use left to move
[
'WebkitTransform',
'MozTransform',
'MsTransform',
'OTransform',
'transform',
'msTransform'
].forEach((prop) => {
this.itemsListRef.style[prop] = CSSTranslate(position, this.props.axis);
});
if (this.itemsListRef) {
[
'WebkitTransform',
'MozTransform',
'MsTransform',
'OTransform',
'transform',
'msTransform'
].forEach((prop) => {
this.itemsListRef.style[prop] = CSSTranslate(position, this.props.axis);
});
}
}

slideRight = (positions) => {
Expand Down

0 comments on commit 987c6c2

Please sign in to comment.