-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Added activeOn 'up/down' property #6807
Conversation
I want to have this option, but not for touch only. If you want to think at something like that, i would appreciate that. |
K, I've changed it to an object level property instead. I've used the name
Github actions seems to work great btw! |
Ok let's discuss it fully, there are a bunch of things i would like to talk about.
|
Good points. Here are my thoughts.
|
I would like to take a safe approach. |
Sounds good, let me know if you think these changes will work. I've taken the approach of simply checking for the Yes, I would use the Also, what kind of test would you suggest adding for this? |
src/mixins/canvas_events.mixin.js
Outdated
@@ -715,7 +721,7 @@ | |||
|
|||
if (target) { | |||
var alreadySelected = target === this._activeObject; | |||
if (target.selectable) { | |||
if (target.selectable && target.activeOn !== 'up') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we specify === 'down' instead of 'up'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we do for json dump on this? We often do not export events/interactions property. But i feel like this is different. I do not want to resolve this in this single PR. Just give it a thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, my thinking in doing it this way was that invalid values would just revert the behavior back to the default but I can change it if you don't think that's necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my intention was to exclude this prop from the json since I feel it's not likely to be changed much and can always be manually included in the extraProperties
array
Are you able to write a small test? |
sure, let me know if I did it correctly |
Let me merge it, i'll play with it and figure out if we need some changes. |
Let me know if this is a feature you think this is worth merging. I've had comments from users who find the touch controls difficult since it's easy to accidentally drag/move an object while trying to select it. This property lets you change the touch behavior to select an object on the first touch, and only drag it on subsequent touches.
Not certain on the property name so let me know if you think of a better one.