fix: Adds check for changedTouches (#5869)

This commit is contained in:
alschmiedt
2022-01-25 14:50:00 -08:00
committed by GitHub
parent 5d7c890243
commit 3f4f505791

View File

@@ -217,7 +217,7 @@ exports.checkTouchIdentifier = checkTouchIdentifier;
* @alias Blockly.Touch.setClientFromTouch
*/
const setClientFromTouch = function(e) {
if (utilsString.startsWith(e.type, 'touch')) {
if (utilsString.startsWith(e.type, 'touch') && e.changedTouches) {
// Map the touch event's properties to the event.
const touchPoint = e.changedTouches[0];
e.clientX = touchPoint.clientX;