Closed Specy closed 3 years ago
Can you create an example in codepen or codesandbox?
https://codesandbox.io/s/fervent-lichterman-5x8vv?file=/src/App.js
top square has element that fills X and registers clicks, the second which has no children filling x, doesn't register any clicks
PIXI's interaction manager calculates the bounding rects of its children to register click events. This is the expected behaviour.
Here's the demo in plain PIXI: https://www.pixiplayground.com/#/edit/xTTZGTcLufmLcSdMkARgM
I have a component which calls another component that returns an interactive container, I've added a click listener to this container and it seems to work, but then I had to add another element other than this container so I used a fragment (<>) to group the two components, at that point the click event stopped working, so the question being, since we have to specify when an element is interactive and if their children are interactive, does the shard also count in this? Is this the reason why the click events don't trigger?
Also, why is a container with set width and height not clickable if its children don't occupy the area?