question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interaction Issue - Button clicks go through to buttons below.

See original GitHub issue

Hi,

We have recently updated our code to use pixi 4.4.0 from 4.3.5 and have come across an issue with mouse/touch events firing on multiple interactive elements when they overlap. This issue is still present in V4.4.2.

We were able to reproduce this issue with this simple PIXI example: https://jsfiddle.net/apodgg2c/2/

Red box is drawn below the blue box.

Click the red box and you get a console output “RED FIRED”

Click the blue box and you get a console output “BLUE FIRED”

Click the overlapping region and both RED and BLUE will fire.

In the previous version (4.3.5) only the BLUE will fire when you click the overlapping region. (as would be expected)

A little more information:

  • If we add two interactive elements (buttons) as siblings to a container then they work fine and they will not click through when they overlap.
  • If you create two containers as children of a parent container and place a button inside each of the containers then it fails.

Here are some examples of scene graph hierarchies and which ones work (no click through) and which ones fail (clicks through)

OK

	Stage
	/  \
     Btn1   Btn2


Fail
	Stage
	/   \
 container container
      /       \  
    Btn1      Btn2


Fail 
(Btn1 added first)
	Stage
	/   \
      Btn1 container
              \  
              Btn2


OK 
(Btn1 added last)
	Stage
	/   \
 container  Btn1
      /         
    Btn2      

Any suggestions for a work around or is this something that will like be fixed in future versions?

This issue may be related to the DOM elements also clicking through? https://github.com/pixijs/pixi.js/issues/3847 https://github.com/pixijs/pixi.js/issues/3790

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
air-commandcommented, Apr 17, 2017

From our perspective this issue has been resolved, thank you. I believe the issue can be closed.

0reactions
lock[bot]commented, Feb 24, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Button clicks go through to buttons below. · Issue #3851 · pixijs ...
Hi,. We have recently updated our code to use pixi 4.4.0 from 4.3.5 and have come across an issue with mouse/touch events firing...
Read more >
HTML "overlay" which allows clicks to fall through to elements ...
I've found a lot of information on the DOM event model, but none of it addresses the problem where the buttons and other...
Read more >
When a Click is Not Just a Click | CSS-Tricks
The click event is usually tied to a pointer device, typically the mouse, and yet here the Space or Enter key are triggering...
Read more >
How (Not) to Build a Button - Ben Myers
Try focusing on the button below while it's disabled, and then try once you've input values below. The button in the above sample...
Read more >
Buttons - Menus and actions - Human Interface Guidelines
A button initiates an instantaneous action. Versatile and highly customizable, buttons give people simple, familiar ways to do tasks in your app.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found