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

'mouse:over' event is not triggered on canvas when moving mouse cursor from out of the canvas to canvas object #2906

Closed
pavloKozlov opened this issue Apr 25, 2016 · 5 comments · Fixed by #2907

Comments

@pavloKozlov
Copy link

Version

1.5.0

Test Case

http://jsfiddle.net/o07eeww5/1/

How it works: rectangle changes it's color to green on mouseover and to red on mouseout.

Steps to reproduce

  • Move mouse cursor over square. It changes color to green ('mouse:over' event)
  • Move mouse cursor to the right out of canvas through rectangle. Color changes to red ('mouseout' event on canvas). But I expected 'mouse:out' event to be fired that also could be a bug.
  • Move mouse to the left to hover rectange

    Expected Behavior

    'mouse:over' event triggered on canvas (rectange changed it's color to green)

Actual Behavior

  • 'mouse:over' is not fired
@asturur
Copy link
Member

asturur commented Apr 25, 2016

similar to this i was investigating today.

#2416

MouseUP does not fire also if we come from outside the canvas.

@asturur
Copy link
Member

asturur commented Apr 25, 2016

mmm not really.

var upperCanvas = canvas.getSelectionElement();
$(upperCanvas).on('mouseout', function(e) {
  canvas._hoveredTarget = null;
    setColorAndAppendText('#ff0000', 'canvas mouse out');
});

if you plan to monitor yout events on the element directly, you should void the canvas._hoveredTarget when canvas mouse out happens.

@asturur asturur closed this as completed Apr 25, 2016
@pavloKozlov
Copy link
Author

I expected 'mouse:out' event triggered and canvas._hoveredTarget cleared when I move cursor out of the canvas because mouse cursor doesn't hover object anymore.
Is there any reason to not clear it?

@asturur
Copy link
Member

asturur commented Apr 25, 2016

when you move out of the canvas we do not have any events over it.
That is why you bound your own event there. Maybe we could support it, but definitely not a bug.

@pavloKozlov
Copy link
Author

Thank you, @asturur.

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.

2 participants