File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,7 @@ module.exports.Component = registerComponent('cursor', {
242242 * in case user mousedowned one entity, dragged to another, and mouseupped.
243243 */
244244 onCursorUp : function ( evt ) {
245+ var data = this . data ;
245246 this . twoWayEmit ( EVENTS . MOUSEUP ) ;
246247
247248 // If intersected entity has changed since the cursorDown, still emit mouseUp on the
@@ -251,7 +252,8 @@ module.exports.Component = registerComponent('cursor', {
251252 this . cursorDownEl . emit ( EVENTS . MOUSEUP , this . intersectedEventDetail ) ;
252253 }
253254
254- if ( ! this . data . fuse && this . intersectedEl && this . cursorDownEl === this . intersectedEl ) {
255+ if ( ( ! data . fuse || data . rayOrigin === 'mouse' ) &&
256+ this . intersectedEl && this . cursorDownEl === this . intersectedEl ) {
255257 this . twoWayEmit ( EVENTS . CLICK ) ;
256258 }
257259
Original file line number Diff line number Diff line change @@ -155,6 +155,16 @@ suite('cursor', function () {
155155 } ) ;
156156 component . onCursorUp ( ) ;
157157 } ) ;
158+
159+ test ( 'emits click event on intersectedEl when fuse and mouse cursor enabled' , function ( done ) {
160+ el . setAttribute ( 'cursor' , 'fuse' , true ) ;
161+ el . setAttribute ( 'cursor' , 'rayOrigin' , 'mouse' ) ;
162+ component . intersection = intersection ;
163+ component . intersectedEl = intersectedEl ;
164+ component . cursorDownEl = intersectedEl ;
165+ once ( intersectedEl , 'click' , function ( ) { done ( ) ; } ) ;
166+ component . onCursorUp ( { type : 'touchend' , preventDefault : function ( ) { } } ) ;
167+ } ) ;
158168 } ) ;
159169
160170 suite ( 'onIntersection' , function ( ) {
You can’t perform that action at this time.
0 commit comments