From 24cbbb7dc702d5a017e3a88ae3cb66cf9f326050 Mon Sep 17 00:00:00 2001 From: Kodub <131988770+Kodub@users.noreply.github.com> Date: Mon, 9 Mar 2026 18:00:50 +0200 Subject: [PATCH] Controls reset touch-action to empty string instead of 'auto' (#33144) --- examples/jsm/controls/ArcballControls.js | 5 ++++- examples/jsm/controls/DragControls.js | 4 ++-- examples/jsm/controls/FirstPersonControls.js | 4 ++-- examples/jsm/controls/FlyControls.js | 4 ++++ examples/jsm/controls/OrbitControls.js | 4 ++-- examples/jsm/controls/TrackballControls.js | 4 ++-- examples/jsm/controls/TransformControls.js | 4 ++-- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/examples/jsm/controls/ArcballControls.js b/examples/jsm/controls/ArcballControls.js index d427d75f4980a9..d0813b420a4467 100644 --- a/examples/jsm/controls/ArcballControls.js +++ b/examples/jsm/controls/ArcballControls.js @@ -453,7 +453,6 @@ class ArcballControls extends Controls { super.connect( element ); - this.domElement.style.touchAction = 'none'; this._devPxRatio = window.devicePixelRatio; this.domElement.addEventListener( 'contextmenu', this._onContextMenu ); @@ -463,6 +462,8 @@ class ArcballControls extends Controls { window.addEventListener( 'resize', this._onWindowResize ); + this.domElement.style.touchAction = 'none'; // Disable touch scroll + } disconnect() { @@ -477,6 +478,8 @@ class ArcballControls extends Controls { window.removeEventListener( 'resize', this._onWindowResize ); + this.domElement.style.touchAction = ''; // Restore touch scroll + } onSinglePanStart( event, operation ) { diff --git a/examples/jsm/controls/DragControls.js b/examples/jsm/controls/DragControls.js index 971cf173862f1d..f01d3f4c0fa97f 100644 --- a/examples/jsm/controls/DragControls.js +++ b/examples/jsm/controls/DragControls.js @@ -139,7 +139,7 @@ class DragControls extends Controls { this.domElement.addEventListener( 'pointerleave', this._onPointerCancel ); this.domElement.addEventListener( 'contextmenu', this._onContextMenu ); - this.domElement.style.touchAction = 'none'; // disable touch scroll + this.domElement.style.touchAction = 'none'; // Disable touch scroll } @@ -151,7 +151,7 @@ class DragControls extends Controls { this.domElement.removeEventListener( 'pointerleave', this._onPointerCancel ); this.domElement.removeEventListener( 'contextmenu', this._onContextMenu ); - this.domElement.style.touchAction = 'auto'; + this.domElement.style.touchAction = ''; // Restore touch scroll this.domElement.style.cursor = ''; } diff --git a/examples/jsm/controls/FirstPersonControls.js b/examples/jsm/controls/FirstPersonControls.js index 7f2a3b064afb99..d2bf4c3cac5af7 100644 --- a/examples/jsm/controls/FirstPersonControls.js +++ b/examples/jsm/controls/FirstPersonControls.js @@ -179,7 +179,7 @@ class FirstPersonControls extends Controls { this.domElement.addEventListener( 'pointerup', this._onPointerUp ); this.domElement.addEventListener( 'contextmenu', this._onContextMenu ); - this.domElement.style.touchAction = 'none'; // disable touch scroll + this.domElement.style.touchAction = 'none'; // Disable touch scroll } @@ -193,7 +193,7 @@ class FirstPersonControls extends Controls { this.domElement.removeEventListener( 'pointerup', this._onPointerUp ); this.domElement.removeEventListener( 'contextmenu', this._onContextMenu ); - this.domElement.style.touchAction = 'auto'; + this.domElement.style.touchAction = ''; // Restore touch scroll } diff --git a/examples/jsm/controls/FlyControls.js b/examples/jsm/controls/FlyControls.js index 860395a716dd91..7bb70187f40c9d 100644 --- a/examples/jsm/controls/FlyControls.js +++ b/examples/jsm/controls/FlyControls.js @@ -109,6 +109,8 @@ class FlyControls extends Controls { this.domElement.addEventListener( 'pointercancel', this._onPointerCancel ); this.domElement.addEventListener( 'contextmenu', this._onContextMenu ); + this.domElement.style.touchAction = 'none'; // Disable touch scroll + } disconnect() { @@ -122,6 +124,8 @@ class FlyControls extends Controls { this.domElement.removeEventListener( 'pointercancel', this._onPointerCancel ); this.domElement.removeEventListener( 'contextmenu', this._onContextMenu ); + this.domElement.style.touchAction = ''; // Restore touch scroll + } dispose() { diff --git a/examples/jsm/controls/OrbitControls.js b/examples/jsm/controls/OrbitControls.js index 3e7df978474979..6060cd4f9a1cb3 100644 --- a/examples/jsm/controls/OrbitControls.js +++ b/examples/jsm/controls/OrbitControls.js @@ -505,7 +505,7 @@ class OrbitControls extends Controls { const document = this.domElement.getRootNode(); // offscreen canvas compatibility document.addEventListener( 'keydown', this._interceptControlDown, { passive: true, capture: true } ); - this.domElement.style.touchAction = 'none'; // disable touch scroll + this.domElement.style.touchAction = 'none'; // Disable touch scroll } @@ -524,7 +524,7 @@ class OrbitControls extends Controls { const document = this.domElement.getRootNode(); // offscreen canvas compatibility document.removeEventListener( 'keydown', this._interceptControlDown, { capture: true } ); - this.domElement.style.touchAction = 'auto'; + this.domElement.style.touchAction = ''; // Restore touch scroll } diff --git a/examples/jsm/controls/TrackballControls.js b/examples/jsm/controls/TrackballControls.js index a2f32cd50962de..469456a9a8e142 100644 --- a/examples/jsm/controls/TrackballControls.js +++ b/examples/jsm/controls/TrackballControls.js @@ -281,7 +281,7 @@ class TrackballControls extends Controls { this.domElement.addEventListener( 'wheel', this._onMouseWheel, { passive: false } ); this.domElement.addEventListener( 'contextmenu', this._onContextMenu ); - this.domElement.style.touchAction = 'none'; // disable touch scroll + this.domElement.style.touchAction = 'none'; // Disable touch scroll } @@ -297,7 +297,7 @@ class TrackballControls extends Controls { this.domElement.removeEventListener( 'wheel', this._onMouseWheel ); this.domElement.removeEventListener( 'contextmenu', this._onContextMenu ); - this.domElement.style.touchAction = 'auto'; // disable touch scroll + this.domElement.style.touchAction = ''; // Restore touch scroll } diff --git a/examples/jsm/controls/TransformControls.js b/examples/jsm/controls/TransformControls.js index c53ae9c652a744..5105c80641c558 100644 --- a/examples/jsm/controls/TransformControls.js +++ b/examples/jsm/controls/TransformControls.js @@ -373,7 +373,7 @@ class TransformControls extends Controls { this.domElement.addEventListener( 'pointermove', this._onPointerHover ); this.domElement.addEventListener( 'pointerup', this._onPointerUp ); - this.domElement.style.touchAction = 'none'; // disable touch scroll + this.domElement.style.touchAction = 'none'; // Disable touch scroll } @@ -384,7 +384,7 @@ class TransformControls extends Controls { this.domElement.removeEventListener( 'pointermove', this._onPointerMove ); this.domElement.removeEventListener( 'pointerup', this._onPointerUp ); - this.domElement.style.touchAction = 'auto'; + this.domElement.style.touchAction = ''; // Restore touch scroll }