diff --git a/.changeset/quiet-parrots-wonder.md b/.changeset/quiet-parrots-wonder.md new file mode 100644 index 0000000000..7857f10d01 --- /dev/null +++ b/.changeset/quiet-parrots-wonder.md @@ -0,0 +1,5 @@ +--- +'react-select-reborn': patch +--- + +Fix touch event error in IE11 diff --git a/packages/react-select/src/Select.js b/packages/react-select/src/Select.js index c8d59039d0..e125664dd1 100644 --- a/packages/react-select/src/Select.js +++ b/packages/react-select/src/Select.js @@ -1026,7 +1026,7 @@ export default class Select extends Component { } } onTouchStart = ({ touches }: TouchEvent) => { - const touch = touches.item(0); + const touch = touches && touches.item(0); if (!touch) { return; } @@ -1036,7 +1036,7 @@ export default class Select extends Component { this.userIsDragging = false; }; onTouchMove = ({ touches }: TouchEvent) => { - const touch = touches.item(0); + const touch = touches && touches.item(0); if (!touch) { return; }