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

Single "click" throw activeSelection fire the mouse:out event (and change hoveredTarget value) on below objects #4218

Closed
ncou opened this issue Aug 17, 2017 · 7 comments
Labels

Comments

@ncou
Copy link
Collaborator

ncou commented Aug 17, 2017

Hi,

I got a strange behaviors with the activeSelection and single click.
It seems like if you click (and don't move) on a space beetween object inside the activeSelection, a mouse:out event is fired, and if there is an object behind, it will change the hoverdTarget value.

=> If you move the cursor (so not a single click, but a click down+move) this behaviors doesn't happen.
=> If you group the activeSelection, this behaviors doesn't happen.

It looks like it's coming from the "findTarget > _fireOverOutEvents" function.

CASE 1 :
Steps :

  • Select the red and green rect using the shift key.
  • Click (single left click) on the blue rect part in the activeSelection (so the left part of the object)
  • The console display the mouse:out event, and the change of the hoveredTarget.
    => Click beetween the 2 objects, the mouse:out is fired.
    => If you click and mouve, the event is not fired.

Expected behaviour : doesn't fire the event, and don't change the hovererTarget.
http://jsfiddle.net/eA3xH/176/

CASE 2 :
When you create a selection using the shift key, the mouse:out event is fired 2 times, while the mouse is still on the object (so it doesn't get out).

Steps :

  • Clear the console
  • Select the red rect
  • Select the green rect (click and maintain the shift key)
    => A first mouse:out event is fired (it's OK because you get out of the red rect).
  • Move a little bit the mouse.
    => A second mouse:out event is fired in the console. It's not normal because the mouse is still in the object.

CASE 3 :

  • Clear the console (or not, it's as you want)
  • Put your mouse on the top left area of the canvas
  • Press left mouse button to start a selection
  • Create a selection and end it with your cursor on the green rect
  • Release the mouse button to create the final selection
    => The selection is created, but the console show a "mouse:out" event fired.
@asturur
Copy link
Member

asturur commented Aug 18, 2017

I m ok with the PART 1 that looks a bug.

PART 2 i cannot replicate. Clearing the console ( getting out of canvas ) while doing those things makes events change. i Cannot replicate if i stay inside the canvas.

@asturur asturur added the bug label Aug 18, 2017
@ncou
Copy link
Collaborator Author

ncou commented Aug 18, 2017

I think Part1 and Part2 come from the same problem.
For Part2, after a few more tests, i think you need to move a bit the mouse to fire the second mouseout event (by the way the first mouseout is ok, because you get out of the first object to select the second one). I will change the usecase.

Can you try this PART 3, and tell me if you reproduce :

  • Clear the console (or not, it's as you want)
  • Put your mouse on the top left area of the canvas
  • Press left mouse button to start a selection
  • create a selection and end it with your cursor on the green rect
  • Release the mouse button to create the final selection
    => The console show a "mouse:out" event fired.

@asturur
Copy link
Member

asturur commented Aug 31, 2017

@ncou i updated fabricjs.com with the latest changes up to now, including this: #4275 that i blindly wrote to try to fix this problem you describe that i guess it happens for the change of object under the mouse pointer.

Could you please help me and verify which of the part 1,2,3 still happens?

@ncou
Copy link
Collaborator Author

ncou commented Aug 31, 2017

hi,

I compiled a version of the lib with the latest source (commited 8 minutes ago), but it's a bad news, i still got the same problem (for part 1,2,3).

@asturur
Copy link
Member

asturur commented Sep 1, 2017

I see... i guess they are all fixable in the way i started. i ll look better.

@asturur
Copy link
Member

asturur commented Sep 3, 2017

wrote #4283. I have no idea if it fixes, for sure it influences the way we fire this event.

@ncou
Copy link
Collaborator Author

ncou commented Sep 23, 2017

@asturur : Tested with the beta7, the case 1 and case 3 are solved, still got the problem with case2.

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

No branches or pull requests

2 participants