Added check for PointerDragBehavior to reenable camera controls, if not reenabled before behavior is disabled
@@ -120,6 +120,7 @@
- Fix crash when cloning material in `AssetContainer.instantiateModelsToScene` when mesh is an instanced mesh ([Popov72](https://github.com/Popov72))
- Fix issue with NinePatch displaying half pixel gaps between slices on Firefox browsers. ([Pryme8](https://github.com/Pryme8))
- Fix issue when canvas loses focus while holding a pointer button ([PolygonalSun](https://github.com/PolygonalSun))
+- Fix issue where camera controls stay detached if PointerDragBehavior is disabled prematurely ([PolygonalSun](https://github.com/PolygonalSun))
## Breaking changes
@@ -187,6 +187,11 @@ export class PointerDragBehavior implements Behavior<AbstractMesh> {
this._pointerObserver = this._scene.onPointerObservable.add((pointerInfo, eventState) => {
if (!this.enabled) {
+ // If behavior is disabled before releaseDrag is ever called, call it now.
+ if (this._attachedToElement) {
+ this.releaseDrag();
+ }
+
return;
}