Skip to content

Commit

Permalink
Merge pull request JedWatson#3904 from andreme/fix_touch_error
Browse files Browse the repository at this point in the history
Fix error when touches is not set
  • Loading branch information
JedWatson authored Aug 27, 2020
2 parents fc7374c + e51f07a commit c5bbe5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-select/src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ export default class Select extends Component<Props, State> {
}
}
onTouchStart = ({ touches }: TouchEvent) => {
const touch = touches.item(0);
const touch = touches && touches.item(0);
if (!touch) {
return;
}
Expand All @@ -1051,7 +1051,7 @@ export default class Select extends Component<Props, State> {
this.userIsDragging = false;
};
onTouchMove = ({ touches }: TouchEvent) => {
const touch = touches.item(0);
const touch = touches && touches.item(0);
if (!touch) {
return;
}
Expand Down

0 comments on commit c5bbe5b

Please sign in to comment.