@@ -436,10 +436,9 @@ export class CanvasSegmentAnythingModule extends CanvasModuleBase {
436
436
} ) ;
437
437
438
438
// Handle manual drag detection for bbox rect
439
- this . konva . bboxRect . on ( 'mousedown touchstart' , ( e ) => {
440
- // Only handle left mouse button (0) or touch events
441
- // For mouse events, evt.button exists; for touch events, it doesn't
442
- if ( 'button' in e . evt && e . evt . button !== 0 ) {
439
+ this . konva . bboxRect . on ( 'pointerdown' , ( e ) => {
440
+ // Only handle left mouse button - other buttons are for panning or context menu
441
+ if ( e . evt . button !== 0 ) {
443
442
return ;
444
443
}
445
444
@@ -464,9 +463,9 @@ export class CanvasSegmentAnythingModule extends CanvasModuleBase {
464
463
} ) ;
465
464
466
465
// Handle transformer interactions
467
- this . konva . bboxTransformer . on ( 'mousedown touchstart ' , ( e ) => {
468
- // Only handle left mouse button (0) or touch events
469
- if ( 'button' in e . evt && e . evt . button !== 0 ) {
466
+ this . konva . bboxTransformer . on ( 'pointerdown ' , ( e ) => {
467
+ // Only handle left mouse button - other buttons are for panning or context menu
468
+ if ( e . evt . button !== 0 ) {
470
469
return ;
471
470
}
472
471
@@ -629,7 +628,7 @@ export class CanvasSegmentAnythingModule extends CanvasModuleBase {
629
628
return ;
630
629
}
631
630
632
- // Only handle left-clicks ( button 0). Ignore middle (1) and right (2) clicks
631
+ // Only handle left mouse button - other buttons are for panning or context menu
633
632
if ( e . evt . button !== 0 ) {
634
633
return ;
635
634
}
@@ -732,7 +731,7 @@ export class CanvasSegmentAnythingModule extends CanvasModuleBase {
732
731
733
732
// Handle visual mode
734
733
if ( data . type === 'visual' ) {
735
- // Only handle left-clicks ( button 0). Ignore middle (1) and right (2) clicks
734
+ // Only handle left mouse button - other buttons are for panning or context menu
736
735
if ( e . evt . button !== 0 ) {
737
736
return ;
738
737
}
@@ -888,7 +887,7 @@ export class CanvasSegmentAnythingModule extends CanvasModuleBase {
888
887
* Handles mouse/touch up for manual bbox dragging
889
888
*/
890
889
onBboxDragEnd = ( e : KonvaEventObject < PointerEvent > ) => {
891
- // Only handle left-clicks ( button 0). Ignore middle (1) and right (2) clicks
890
+ // Only handle left mouse button - other buttons are for panning or context menu
892
891
if ( e . evt . button !== 0 ) {
893
892
return ;
894
893
}
0 commit comments