Skip to content
Merged
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: 4 additions & 1 deletion examples/jsm/controls/ArcballControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -463,6 +462,8 @@ class ArcballControls extends Controls {

window.addEventListener( 'resize', this._onWindowResize );

this.domElement.style.touchAction = 'none'; // Disable touch scroll

}

disconnect() {
Expand All @@ -477,6 +478,8 @@ class ArcballControls extends Controls {

window.removeEventListener( 'resize', this._onWindowResize );

this.domElement.style.touchAction = ''; // Restore touch scroll

}

onSinglePanStart( event, operation ) {
Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/controls/DragControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

Expand All @@ -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 = '';

}
Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/controls/FirstPersonControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

Expand All @@ -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

}

Expand Down
4 changes: 4 additions & 0 deletions examples/jsm/controls/FlyControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/controls/OrbitControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

Expand All @@ -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

}

Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/controls/TrackballControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

Expand All @@ -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

}

Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/controls/TransformControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

Expand All @@ -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

}

Expand Down
Loading