@@ -797,7 +797,7 @@ AFRAME.registerComponent('clickable', AFRAME.utils.extendDeep({}, buttonCore, {
797797 this . el . removeEventListener ( this . UNCLICK_EVENT , this . end ) ;
798798 } ,
799799 start : function ( evt ) {
800- if ( ! this . startButtonOk ( evt ) ) {
800+ if ( evt . defaultPrevented || ! this . startButtonOk ( evt ) ) {
801801 return ;
802802 }
803803 this . el . addState ( this . CLICKED_STATE ) ;
@@ -810,7 +810,7 @@ AFRAME.registerComponent('clickable', AFRAME.utils.extendDeep({}, buttonCore, {
810810 } ,
811811 end : function ( evt ) {
812812 const handIndex = this . clickers . indexOf ( evt . detail . hand ) ;
813- if ( ! this . endButtonOk ( evt ) ) {
813+ if ( evt . defaultPrevented || ! this . endButtonOk ( evt ) ) {
814814 return ;
815815 }
816816 if ( handIndex !== - 1 ) {
@@ -923,7 +923,7 @@ AFRAME.registerComponent('draggable', inherit({}, buttonCore, {
923923 this . el . removeEventListener ( this . UNDRAG_EVENT , this . dragEnd ) ;
924924 } ,
925925 dragStart : function ( evt ) {
926- if ( ! this . startButtonOk ( evt ) ) {
926+ if ( evt . defaultPrevented || ! this . startButtonOk ( evt ) ) {
927927 return ;
928928 }
929929 this . el . addState ( this . DRAGGED_STATE ) ;
@@ -932,7 +932,7 @@ AFRAME.registerComponent('draggable', inherit({}, buttonCore, {
932932 }
933933 } ,
934934 dragEnd : function ( evt ) {
935- if ( ! this . endButtonOk ( evt ) ) {
935+ if ( evt . defaultPrevented || ! this . endButtonOk ( evt ) ) {
936936 return ;
937937 }
938938 this . el . removeState ( this . DRAGGED_STATE ) ;
@@ -1026,7 +1026,7 @@ AFRAME.registerComponent('droppable', {
10261026 return false ;
10271027 } ,
10281028 hoverStart : function ( evt ) {
1029- if ( ! this . entityAcceptable ( evt . detail . carried ) ) {
1029+ if ( evt . defaultPrevented || ! this . entityAcceptable ( evt . detail . carried ) ) {
10301030 return ;
10311031 }
10321032 this . el . addState ( this . HOVERED_STATE ) ;
@@ -1035,9 +1035,15 @@ AFRAME.registerComponent('droppable', {
10351035 }
10361036 } ,
10371037 hoverEnd : function ( evt ) {
1038+ if ( evt . defaultPrevented ) {
1039+ return ;
1040+ }
10381041 this . el . removeState ( this . HOVERED_STATE ) ;
10391042 } ,
10401043 dragDrop : function ( evt ) {
1044+ if ( evt . defaultPrevented ) {
1045+ return ;
1046+ }
10411047 const dropped = evt . detail . dropped ;
10421048 if ( ! this . entityAcceptable ( dropped ) ) {
10431049 if ( this . data . rejectEvent . length ) {
@@ -1120,7 +1126,7 @@ AFRAME.registerComponent('grabbable', inherit({}, physicsCore, buttonsCore, {
11201126 this . physicsRemove ( ) ;
11211127 } ,
11221128 start : function ( evt ) {
1123- if ( ! this . startButtonOk ( evt ) ) {
1129+ if ( evt . defaultPrevented || ! this . startButtonOk ( evt ) ) {
11241130 return ;
11251131 }
11261132 // room for more grabbers?
@@ -1147,7 +1153,7 @@ AFRAME.registerComponent('grabbable', inherit({}, physicsCore, buttonsCore, {
11471153 } ,
11481154 end : function ( evt ) {
11491155 const handIndex = this . grabbers . indexOf ( evt . detail . hand ) ;
1150- if ( ! this . endButtonOk ( evt ) ) {
1156+ if ( evt . defaultPrevented || ! this . endButtonOk ( evt ) ) {
11511157 return ;
11521158 }
11531159 if ( handIndex !== - 1 ) {
@@ -1209,6 +1215,9 @@ AFRAME.registerComponent('hoverable', {
12091215 this . el . removeEventListener ( this . UNHOVER_EVENT , this . end ) ;
12101216 } ,
12111217 start : function ( evt ) {
1218+ if ( evt . defaultPrevented ) {
1219+ return ;
1220+ }
12121221 this . el . addState ( this . HOVERED_STATE ) ;
12131222 if ( this . hoverers . indexOf ( evt . detail . hand ) === - 1 ) {
12141223 this . hoverers . push ( evt . detail . hand ) ;
@@ -1218,6 +1227,9 @@ AFRAME.registerComponent('hoverable', {
12181227 }
12191228 } ,
12201229 end : function ( evt ) {
1230+ if ( evt . defaultPrevented ) {
1231+ return ;
1232+ }
12211233 var handIndex = this . hoverers . indexOf ( evt . detail . hand ) ;
12221234 if ( handIndex !== - 1 ) {
12231235 this . hoverers . splice ( handIndex , 1 ) ;
@@ -1375,7 +1387,7 @@ AFRAME.registerComponent('stretchable', inherit({}, buttonCore, {
13751387 this . el . removeEventListener ( this . UNSTRETCH_EVENT , this . end ) ;
13761388 } ,
13771389 start : function ( evt ) {
1378- if ( this . stretched || this . stretchers . includes ( evt . detail . hand ) || ! this . startButtonOk ( evt ) ) {
1390+ if ( this . stretched || this . stretchers . includes ( evt . detail . hand ) || ! this . startButtonOk ( evt ) || evt . defaultPrevented ) {
13791391 return ;
13801392 } // already stretched or already captured this hand or wrong button
13811393 this . stretchers . push ( evt . detail . hand ) ;
@@ -1390,7 +1402,7 @@ AFRAME.registerComponent('stretchable', inherit({}, buttonCore, {
13901402 } ,
13911403 end : function ( evt ) {
13921404 var stretcherIndex = this . stretchers . indexOf ( evt . detail . hand ) ;
1393- if ( ! this . endButtonOk ( evt ) ) {
1405+ if ( evt . defaultPrevented || ! this . endButtonOk ( evt ) ) {
13941406 return ;
13951407 }
13961408 if ( stretcherIndex !== - 1 ) {
0 commit comments