From adb1fc03c4f1cdb7efa7c01e7def6ee100194464 Mon Sep 17 00:00:00 2001 From: Philipp Date: Mon, 22 Jan 2024 11:45:42 +0100 Subject: [PATCH] fix: remove Click + CTRL for adding to selection Closes #849 --- lib/features/selection/SelectionBehavior.js | 4 +-- .../selection/SelectionBehaviorSpec.js | 34 ------------------- 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/lib/features/selection/SelectionBehavior.js b/lib/features/selection/SelectionBehavior.js index 8e2e6e81c..9c8a1c0d0 100644 --- a/lib/features/selection/SelectionBehavior.js +++ b/lib/features/selection/SelectionBehavior.js @@ -91,8 +91,8 @@ export default function SelectionBehavior(eventBus, selection, canvas, elementRe var isSelected = selection.isSelected(element), isMultiSelect = selection.get().length > 1; - // Add to selection if CTRL or SHIFT pressed - var add = hasPrimaryModifier(event) || hasSecondaryModifier(event); + // Add to selection if SHIFT pressed + var add = hasSecondaryModifier(event); if (isSelected && isMultiSelect) { if (add) { diff --git a/test/spec/features/selection/SelectionBehaviorSpec.js b/test/spec/features/selection/SelectionBehaviorSpec.js index 63b2ea43a..122936c98 100644 --- a/test/spec/features/selection/SelectionBehaviorSpec.js +++ b/test/spec/features/selection/SelectionBehaviorSpec.js @@ -363,23 +363,6 @@ describe('features/selection/Selection', function() { })); - it('should add element to selection on click + CTRL', - inject(function(eventBus, selection) { - - // given - selection.select(shape1); - - // when - eventBus.fire(clickEvent(shape2, keyModifier)); - - // then - expect(selection.get()).to.have.length(2); - expect(selection.isSelected(shape1)).to.be.true; - expect(selection.isSelected(shape2)).to.be.true; - }) - ); - - it('should add element to selection on click + SHIFT', inject(function(eventBus, selection) { @@ -397,23 +380,6 @@ describe('features/selection/Selection', function() { ); - it('should remove selected element from selection on click + CTRL', - inject(function(eventBus, selection) { - - // given - selection.select([ shape1, shape2 ]); - - // when - eventBus.fire(clickEvent(shape1, keyModifier)); - - // then - expect(selection.get()).to.have.length(1); - expect(selection.isSelected(shape1)).to.be.false; - expect(selection.isSelected(shape2)).to.be.true; - }) - ); - - it('should remove selected element from selection on click + SHIFT', inject(function(eventBus, selection) {