fix(OrbitControls): restore touchAction on dispose #357
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thetouchAction
, 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
tonone
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 settouchAction
toauto
Checklist