Skip to content

Commit

Permalink
Editor: Fixed UINumber mobile UX.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Nov 30, 2023
1 parent 84424e4 commit a45cf54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion editor/js/libs/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ class UINumber extends UIElement {
prevPointer.x = event.touches[ 0 ].pageX;
prevPointer.y = event.touches[ 0 ].pageY;

document.addEventListener( 'touchmove', onTouchMove );
document.addEventListener( 'touchmove', onTouchMove, { passive: false } );
document.addEventListener( 'touchend', onTouchEnd );

}
Expand All @@ -625,6 +625,8 @@ class UINumber extends UIElement {

function onTouchMove( event ) {

event.preventDefault();

const currentValue = scope.value;

pointer.x = event.touches[ 0 ].pageX;
Expand Down

0 comments on commit a45cf54

Please sign in to comment.