diff --git a/cvat-canvas/src/typescript/editHandler.ts b/cvat-canvas/src/typescript/editHandler.ts index 07f366d6..ba0ed7f6 100644 --- a/cvat-canvas/src/typescript/editHandler.ts +++ b/cvat-canvas/src/typescript/editHandler.ts @@ -96,10 +96,10 @@ export class EditHandlerImpl implements EditHandler { let mouseY: number | null = null; this.canvas.on('mousedown.edit', (e: MouseEvent): void => { - if (e.which === 1) { + if (e.button === 0) { mouseX = e.clientX; mouseY = e.clientY; - } else if (e.which === 3 && this.editLine) { + } else if (e.button === 2 && this.editLine) { if (this.editData.state.shapeType === 'points' || this.editLine.attr('points').split(' ').length > 2 ) { @@ -110,7 +110,7 @@ export class EditHandlerImpl implements EditHandler { this.canvas.on('mouseup.edit', (e: MouseEvent): void => { const threshold = 10; // px - if (e.which === 1) { + if (e.button === 0) { if (Math.sqrt( // l2 distance < threshold ((mouseX - e.clientX) ** 2) + ((mouseY - e.clientY) ** 2),