"click area" is clicked even when it's not on the canvas

I have modals (html elements) on top of the canvas that can appear when things happen.

When user are clicking on the modals, if under it there is an interactive area of the canvas, it is triggered.

Is there any way to tell the canvas to only listen to events if the event target is the canvas?

Try

new Phaser.Game({
  input: { windowEvents: false }
});

Thank you this did the trick!