Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(OrbitControls): restore touchAction on dispose #357

Merged
merged 1 commit into from
Apr 27, 2024

Conversation

ankitskvmdam
Copy link
Contributor

@ankitskvmdam ankitskvmdam commented Apr 23, 2024

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

  • Documentation updated
  • Storybook entry added
  • Ready to be merged

Copy link

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.

@CodyJasonBennett CodyJasonBennett merged commit e1f6d3e into pmndrs:main Apr 27, 2024
3 checks passed
@CodyJasonBennett CodyJasonBennett changed the title Enabling touchAction when this.dispose is called. fix(OrbitControls): restore touchAction on dispose Apr 27, 2024
Copy link

🎉 This PR is included in version 2.29.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants