File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
packages/pointer-events/src Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ export class Pointer {
127
127
private buttonsDownTime : ButtonsTime = new Map ( )
128
128
private readonly buttonsDown = new Set < number > ( )
129
129
130
- //to handle interaction before first move
130
+ //to handle interaction before first move (after exit)
131
131
private wasMoved = false
132
132
private onFirstMove : Array < ( camera : PerspectiveCamera | OrthographicCamera ) => void > = [ ]
133
133
@@ -392,18 +392,17 @@ export class Pointer {
392
392
}
393
393
394
394
exit ( nativeEvent : NativeEvent ) : void {
395
- if ( ! this . wasMoved ) {
396
- this . onFirstMove . push ( this . exit . bind ( this , nativeEvent ) )
397
- return
398
- }
399
-
400
- //reset state
401
- if ( this . pointerCapture != null ) {
402
- this . parentReleasePointerCapture ?.( )
403
- this . pointerCapture = undefined
395
+ if ( this . wasMoved ) {
396
+ //reset state
397
+ if ( this . pointerCapture != null ) {
398
+ this . parentReleasePointerCapture ?.( )
399
+ this . pointerCapture = undefined
400
+ }
401
+ this . intersection = undefined
402
+ this . commit ( nativeEvent )
404
403
}
405
- this . intersection = undefined
406
- this . commit ( nativeEvent )
404
+ this . onFirstMove . length = 0
405
+ this . wasMoved = false
407
406
}
408
407
}
409
408
You can’t perform that action at this time.
0 commit comments