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

Group selection using mouse drag not working over top nonselectable objects #1506

Closed
nexttech opened this issue Jul 18, 2014 · 9 comments · Fixed by #3892
Closed

Group selection using mouse drag not working over top nonselectable objects #1506

nexttech opened this issue Jul 18, 2014 · 9 comments · Fixed by #3892
Assignees

Comments

@nexttech
Copy link

When attempting to group select objects by dragging the mouse, if the starting point is over top of a unselectable object then the group selection box is not even initiated.

This is a bug that came somewhere between version 1.4.7 & 1.4.8

It can be easily verified here: http://fabricjs.com/customization/
Under "Unselectable object" example

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@zigmo
Copy link

zigmo commented Jul 19, 2014

Same here - version 1.4.7.
It only works if an other object is selected/active. It can be also verified here: http://fabricjs.com/customization/ (If one of the green rects is selected/active)

@jhundley9109
Copy link

I am also running into this issue. Dragging and making an empty selection makes group selection starting on the unselectable object not possible.

As mentioned before, go to http://fabricjs.com/customization/
Then under unselectable, make an empty selection, and then begin your selection on the unselectable object. It does not have expected results.

@asturur
Copy link
Member

asturur commented Sep 29, 2015

@kangax, should the selection start if we are starting from the unselectable area?
Which is the desired behaviour?

@jhundley9109
Copy link

I would like to implement something along the lines as seen in this fiddle. This is not my fiddle, I just found it among searches... Starting the selection in the rectangle only works if you select an active object and then click in the square.

http://jsfiddle.net/PromInc/ZxYCP/

This bug is apparent in this example as well. With the way it is now, I would not be able to do a solution like this. Is there a workaround possibly?

@kangax
Copy link
Member

kangax commented Oct 3, 2015

@kangax, should the selection start if we are starting from the unselectable area?

I think it should. It just shouldn't affect unselectable object, obviously, but might affect others.

@asturur
Copy link
Member

asturur commented Oct 3, 2015

gonna check it.

@gandhimaulik
Copy link

is this fixed yet ?
I also have experienced same issue.

@asturur
Copy link
Member

asturur commented Apr 25, 2016

_shouldClearSelection: function (e, target) {
var activeGroup = this.getActiveGroup(),
activeObject = this.getActiveObject();

        return (
        !target
        ||
        (target &&
        activeGroup &&
        !activeGroup.contains(target) &&
        activeGroup !== target &&
        !e.shiftKey)
        ||
        (target && !target.evented)
        ||
        (target &&
        !target.selectable) // also return true if the target is present but non selectable
        ||
        (activeObject &&
        activeObject !== target)
        );
    }

@asturur
Copy link
Member

asturur commented Apr 27, 2017

i need to fix it for my own things. so the time has come!

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 a pull request may close this issue.

6 participants