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

**URL:** <https://phaser.discourse.group/t/click-area-is-clicked-even-when-its-not-on-the-canvas/14410>\
**Category:** Phaser 3\
**Created:** [June 6, 2024, 5:53pm UTC](https://phaser.discourse.group/t/click-area-is-clicked-even-when-its-not-on-the-canvas/14410 "2024-06-06T17:53:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dievardump](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/dievardump/32/8324_2.png) [@dievardump](https://phaser.discourse.group/u/dievardump)\
**Post date:** [June 6, 2024, 5:53pm UTC](https://phaser.discourse.group/t/click-area-is-clicked-even-when-its-not-on-the-canvas/14410/1 "2024-06-06T17:53:33Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [June 6, 2024, 6:08pm UTC](https://phaser.discourse.group/t/click-area-is-clicked-even-when-its-not-on-the-canvas/14410/2 "2024-06-06T18:08:34Z")

</div>

Try

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

```

---

<div class="post-metadata">

**Author:** ![dievardump](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/dievardump/32/8324_2.png) [@dievardump](https://phaser.discourse.group/u/dievardump)\
**Post date:** [June 7, 2024, 1:36pm UTC](https://phaser.discourse.group/t/click-area-is-clicked-even-when-its-not-on-the-canvas/14410/3 "2024-06-07T13:36:20Z")

</div>

Thank you this did the trick!
