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

Fix error when touches is not set #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quiet-parrots-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-select-reborn': patch
---

Fix touch event error in IE11
4 changes: 2 additions & 2 deletions packages/react-select/src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,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 @@ -1036,7 +1036,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