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

Cursor events not detected on overlapping objects with selectable:false #5203

Closed
AshwinTayson opened this issue Aug 28, 2018 · 5 comments · Fixed by #5259
Closed

Cursor events not detected on overlapping objects with selectable:false #5203

AshwinTayson opened this issue Aug 28, 2018 · 5 comments · Fixed by #5259
Labels

Comments

@AshwinTayson
Copy link

Version

2.3.5

Test Case

http://jsfiddle.net/Da7SP/2732/

Steps to reproduce

Case 1: Hover over the red rectangle overlapped by the blue
Case 2: Click the red rectangle overlapped by the blue
Case 3: Mouse down and drag the red rectangle overlapped by the blue, then mouse up

Expected Behavior

Case 1: Mouse cursor should have a 'pointer' cursor
Case 2: Red rectangle should be selected
Case 3. Red rectangle should be dragged

Actual Behavior

Case 1: It takes default cursor. Something like css pointer-events: none is needed for objects with selectable: false
Case 2: Red rectangle is selected (Pass)
Case 3: It creates a selection box and then the red rectangle is selected. If any other object is nearby the whole group is selected.

I'm not sure if this is a bug or a feature request. Is it possible to detect the object underneath while hovering, when objectPreserveStacking is true? How should this be handled? Is there a CSS property like pointer-events: none?

@asturur
Copy link
Member

asturur commented Sep 5, 2018

i m confused.
The red should not be selectable at all under a unselectable blue.
I need to verify why/how.
But this cannot be fixed before we get interaction tests, or will likely break again.

The property you are looking for is maybe:
http://fabricjs.com/docs/fabric.Object.html#evented

@asturur asturur added the bug label Sep 5, 2018
@AshwinTayson
Copy link
Author

I'm sorry I forgot to close this issue. After scouring through the doc I found evented as you pointed out. Thanks for the response.

@asturur
Copy link
Member

asturur commented Sep 5, 2018

still i see a bug, do not close

@blobinabottle
Copy link
Contributor

Why is this a bug? actually it seems logic that red is selectable under an unselectable blue.
To me the bug is that you can't drag the red if it's under an unselectable object when preserveObjectStacking is true.

@asturur
Copy link
Member

asturur commented Sep 8, 2018

not really. that would be an object without mouse events.

Unselectable has always been that does not get selected as side effect of mouse down, but it will consume the click

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants