Hello, I’ve been playing with Phaser recently and everything works fine until yesterday the pointerup and pointerwheel listeners stopped being triggered. I’ve put together a github repo that can help reproduce the issue
The symptoms I saw are:
keyboard navigation continue to work, using up/down/left/right
mouse down events is captured in the update() method in the Scene.tsx file
pointerup/pointerwheel are not triggered at all
I have no clue where to look at next. Please advice.
What you can try to do it, at the index.html body, create a div with your unique id, then in the game config where you implement the dom option, set the parent to be the id of the div.
Once that’s all setup, you can catch your div and add there the pointers events.
// html.body
<div id="groot"> </div>
// game.config
// Must for DOM
parent: "groot",
dom: {
createContainer: true
},
// End - Must for DOM
Thank you for the help. What I noticed is that in the dom container created by Phaser, it should have CSS rule
pointer-events: none
This will allow the Phaser canvas to capture the click events. However, in my example, pointer-events was set to “auto” instead of “none”. I don’t know what is causing this issue. But I can add my own CSS rule to override that setup and make it work now.
Yep, that’s the issue I had, that suddenly couldn’t click 3/4 of the screen, until found out that it was the phaser.div which had the rule of pointer-events…
I couldn’t find something concrete about how phaser set the rule, so overriding the CSS sounds the best…
If you override or find another solution, please post it here for future devs that will get stuck with the same bug