Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove Click + CTRL for adding to selection #850

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/features/selection/SelectionBehavior.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
hasPrimaryModifier,
hasSecondaryModifier,
isPrimaryButton
} from '../../util/Mouse';
Expand Down Expand Up @@ -91,8 +90,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) {
Expand Down
38 changes: 0 additions & 38 deletions test/spec/features/selection/SelectionBehaviorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ import {
createCanvasEvent as canvasEvent
} from '../../../util/MockEvents';

import { isMac } from 'lib/util/Platform';

var keyModifier = isMac() ? { metaKey: true } : { ctrlKey: true };


describe('features/selection/Selection', function() {

Expand Down Expand Up @@ -363,23 +359,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) {

Expand All @@ -397,23 +376,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) {

Expand Down
Loading