mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-16 17:51:07 +00:00
Update _fireOverOutEvents to pass event object (#3853)
I encountered a scenario where we were listening for `mouseout` and calling `_isObjectMoved` expecting an event object to be passed from the `mouseout` listener, however the object was not passed from `_fireOverOutEvents`. Normally this would not be an issue as `_isObjectMoved()` -> `getPointer()` checks for `fabric.window.event` and uses that if `event` is undefined, but this produces an error in Firefox as the `window.event` property is not implemented (https://developer.mozilla.org/en-US/docs/Web/API/Window/event). To resolve this I am proposing that `_fireOverOutEvents` pass along the event object to the target so that it can be passed along to `isObjectMoved()` if necessary.
This commit is contained in:
parent
28729b3786
commit
bdc97a8132
1 changed files with 3 additions and 3 deletions
|
|
@ -1136,16 +1136,16 @@
|
|||
if (this._hoveredTarget !== target) {
|
||||
if (this._hoveredTarget) {
|
||||
this.fire('mouse:out', { target: this._hoveredTarget, e: e });
|
||||
this._hoveredTarget.fire('mouseout');
|
||||
this._hoveredTarget.fire('mouseout', { e: e });
|
||||
}
|
||||
this.fire('mouse:over', { target: target, e: e });
|
||||
target.fire('mouseover');
|
||||
target.fire('mouseover', { e: e });
|
||||
this._hoveredTarget = target;
|
||||
}
|
||||
}
|
||||
else if (this._hoveredTarget) {
|
||||
this.fire('mouse:out', { target: this._hoveredTarget, e: e });
|
||||
this._hoveredTarget.fire('mouseout');
|
||||
this._hoveredTarget.fire('mouseout', { e: e });
|
||||
this._hoveredTarget = null;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue