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

Allow multiple keys to enable multiple click selection #4184

Merged
merged 6 commits into from
Sep 29, 2017

Conversation

brianchitester
Copy link
Contributor

Changed selectionKey to an array in order to allow multiple keys to enable multi click selection. I thought this would be useful since, in my application that uses fabric.js, I would like to make it so that holding either shift or ctrl will enable multi selection. This is consistent with the behavior in other editors like Google Slides.

if (e[selectionKey]){
selectionKeyPressed = true;
}
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anyway this could be done with this.selectionKeys.some(function(key) { return e[selectionKey]; }) ? is still ES5 and i think has the same performance of forEach.

@asturur
Copy link
Member

asturur commented Aug 9, 2017

The problem of this change is that it breaks the api, again.
Whoever is changing the value of that key is getting a failure after this update.

@brianchitester
Copy link
Contributor Author

I'll push an update soon that allows for backwards compatibility.

@asturur
Copy link
Member

asturur commented Aug 9, 2017

yeah let me also think about it. i m not sure i want to push it in. I need to recap all the key combination and figure out if setting this for more keys can cause problems.

I m not a fan of too many features

@brianchitester
Copy link
Contributor Author

Sure, thanks for considering ✌️

@asturur
Copy link
Member

asturur commented Sep 29, 2017

I m going to merge this, i need to clean it a bit, but talking with some people we decided that this feature is indeed requested by users because of the differences on how selection works in different software/OS.

so... thanks!

@asturur asturur merged commit d88af28 into fabricjs:master Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants