mirror of
https://github.com/google/blockly.git
synced 2026-01-05 08:00:09 +01:00
fix(touch): prevent infinite loop on multi-touch drag (#8470)
* Change in gesture.ts * prettier
This commit is contained in:
@@ -599,13 +599,20 @@ export class Gesture {
|
||||
*/
|
||||
handleTouchMove(e: PointerEvent) {
|
||||
const pointerId = Touch.getTouchIdentifierFromEvent(e);
|
||||
// Update the cache
|
||||
this.cachedPoints.set(pointerId, this.getTouchPoint(e));
|
||||
|
||||
if (this.isPinchZoomEnabled && this.cachedPoints.size === 2) {
|
||||
this.handlePinch(e);
|
||||
} else {
|
||||
this.handleMove(e);
|
||||
// Handle the move directly instead of calling handleMove
|
||||
this.updateFromEvent(e);
|
||||
if (this.workspaceDragger) {
|
||||
this.workspaceDragger.drag(this.currentDragDeltaXY);
|
||||
} else if (this.dragger) {
|
||||
this.dragger.onDrag(this.mostRecentEvent, this.currentDragDeltaXY);
|
||||
}
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
3
package-lock.json
generated
3
package-lock.json
generated
@@ -47,7 +47,7 @@
|
||||
"markdown-tables-to-json": "^0.1.7",
|
||||
"mocha": "^10.0.0",
|
||||
"patch-package": "^8.0.0",
|
||||
"prettier": "3.3.3",
|
||||
"prettier": "^3.3.3",
|
||||
"readline-sync": "^1.4.10",
|
||||
"rimraf": "^5.0.0",
|
||||
"typescript": "^5.3.3",
|
||||
@@ -9600,6 +9600,7 @@
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
|
||||
"integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
"markdown-tables-to-json": "^0.1.7",
|
||||
"mocha": "^10.0.0",
|
||||
"patch-package": "^8.0.0",
|
||||
"prettier": "3.3.3",
|
||||
"prettier": "^3.3.3",
|
||||
"readline-sync": "^1.4.10",
|
||||
"rimraf": "^5.0.0",
|
||||
"typescript": "^5.3.3",
|
||||
|
||||
Reference in New Issue
Block a user