-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Controls: Remove preventDefault() from mouse handlers. #21935
Conversation
Thanks! |
Are you sure you want to do this? class OrbitControls extends EventDispatcher {
constructor( object, domElement ) {
+ this.preventDefault = true;
function onMouseDown( event ) {
- event.preventDefault();
+ if( this.preventDefault ) {
+ event.preventDefault();
+ }
}
}
} |
Why is this change radical and crazy? Do you mind explaining your concerns in more detail? |
If the <canvas /> is full of document.body, everything is fine.
|
Well, according to a lot of user feedback the new behavior is the more expected one. I also think that it was a mistake to add |
I'll add a note in the migration guide. Just to be on the safe side. |
* chore: remove event.preventDefault from orbit controls as per mrdoob/three.js#21935 * chore: remove event.preventDefault from drag controls * chore: remove event.preventDefault from first person controls * chore: remove event.preventDefault from fly controls * chore: remove event.preventDefault from trackball controls
…ion, no need to scale on client) Add support for a grid of canvases for each scene. Optimize by only creating 1 row or column of canvases for axes scenes. Re-add event.preventDefault() to mouseDown and mouseMove listeners which were removed in this PR: mrdoob/three.js#21935 Use a "noCreateCanvas" flag to tell the client not to create a canvas grid for a Scene. Create and dispose of canvases in the grid as they enter and exit the viewport. Don't reproject static text anchors on a pan, just move the div. Add zoom support for PanInteractor. Adapt to window.devicePixelRatio being changed without a page reload. Fix GPU picking when devicePixelRatio != 1 Update to three.js r137.4
* chore: remove event.preventDefault from orbit controls as per mrdoob/three.js#21935 * chore: remove event.preventDefault from drag controls * chore: remove event.preventDefault from first person controls * chore: remove event.preventDefault from fly controls * chore: remove event.preventDefault from trackball controls
Related issue: #21889
Description
This PR removes all calls of
preventDefault()
in mouse handlers from all controls classes to avoid side-effects mentioned in #21889. During my local testing with the examples I was not able to spot a different behavior.