Bug with mouse events on overlapping interactive elements
See original GitHub issueUsing Pixi.js 4.2.3 - ✰ WebGL ✰
I have two sprites that overlap partially. They have the following code attached for example purposes (I cut out some excess and this will need to be modified slightly to actually work):
let marker = new pixi.Sprite(this._texture);
marker.interactive = true;
marker.on('mouseover', this._onMarkerMouseOver);
marker.on('mouseout', this._onMarkerMouseOut);
notifyMouseOverMarker (spriteMarker) {
console.log('over', spriteMarker.identifier, this._markersUnderMouse);
}
notifyMouseOutMarker (spriteMarker) {
console.log('out', spriteMarker.identifier, this._markersUnderMouse);
}
This is what I get in my console:
Notice that the 6cb255
marker gets the mouseout
event twice, once before it even gets the mouseover
event… ??
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Bug with mouse events on overlapping interactive elements
Using Pixi.js 4.2.3 - ✰ WebGL ✰ I have two sprites that overlap partially. They have the following code attached for example purposes...
Read more >How to enable javascript mouse events on overlapping html ...
The inline html has clickable elements, and the fixed div has a hover event. The fixed element is an empty div, so it...
Read more >[Nifty1.3] Mouse click event is delivered to all of the overlapping ...
If elements are overlapped and all elements are set to visibleToMouse(true), then all elements get the mouse click event. It seems inappropriate.
Read more >Onover problem When moving the mouse quickly - krpano.com
The root problem here is a longstanding Chrome bug: Chrome doesn't fire 'over' events when new elements appears under the mouse.
Read more >Controlling User Interaction on Nodes - Apple Developer
Nodes that have user interaction disabled will block touch and mouse events on nodes behind them where they overlap. See Also. Handling User...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here is an example of the issue: https://jsfiddle.net/gf2sabv7/ Check the console to see how the wrong sprite is passed as the event.data.target
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.