pmndrs / three-stdlib

📚 Stand-alone library of threejs examples designed to run without transpilation in node & browser
https://npmjs.com/three-stdlib
MIT License
676 stars 110 forks source link

fix(OrbitControls): restore touchAction on dispose #357

Closed ankitskvmdam closed 2 months ago

ankitskvmdam commented 2 months ago

Why

When connecting to the OrbitControl, we set touchAction to none, which prevents the user from scrolling the page and allows them to interact with the 3D scene. However, when we dispose of the OrbitControl, we don't re-enable the touchAction, which means the user is unable to scroll the page even after the OrbitControl is disabled or removed.

There are situations where we want to allow users to interact with the scene when they click a button, but in other cases, we don't want them to interact, and instead, allow them to scroll the page. However, if we set the touchAction to none and don't re-enable it after disposing of the OrbitControl, the user will be unable to scroll the page at all.

What

In this.dispose method, I set touchAction to auto

Checklist

codesandbox-ci[bot] commented 2 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

github-actions[bot] commented 2 months ago

:tada: This PR is included in version 2.29.7 :tada:

The release is available on:

Your semantic-release bot :package::rocket: