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

PivotControls - preventDefault onContext & operate controls only with button 0 #1926

Open
romankoho opened this issue Apr 18, 2024 · 0 comments · May be fixed by #1932
Open

PivotControls - preventDefault onContext & operate controls only with button 0 #1926

romankoho opened this issue Apr 18, 2024 · 0 comments · May be fixed by #1932
Labels
enhancement New feature or request

Comments

@romankoho
Copy link
Contributor

Describe the feature you'd like:

I'm using PivotControls in a scene with OrbitControls. It happens that I'm close to the control but want to pan the OrbitControls with a right click. In such cases, the browser opens a default menu. I would prefer no reaction on the right (context) click.

pivotControls - onContext

Moreover, I think it is more intuitive if the PivotControls can only be operated with mouse button 0 (left button)

Suggested implementation:

In the single components , , , the event needs to cancel the default behavior:

 onContextMenu={(e) => {
          e.nativeEvent.preventDefault()
  }}

moreover, I would add the check for button = 0 in the onPointerDown event

onPointerDown={(e) => {
          if (e.button !== 0) {
            return
          }
          onPointerDown(e)
        }}
@romankoho romankoho added the enhancement New feature or request label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant