# Prevent phaser from receiveing events through ion-select that opens on top of it

**URL:** <https://forum.ionicframework.com/t/prevent-phaser-from-receiveing-events-through-ion-select-that-opens-on-top-of-it/243234>\
**Category:** Ionic Framework\
**Created:** [July 22, 2024, 2:06pm UTC](https://forum.ionicframework.com/t/prevent-phaser-from-receiveing-events-through-ion-select-that-opens-on-top-of-it/243234 "2024-07-22T14:06:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![h3inz](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/h3inz/32/136542_2.png) [@h3inz](https://forum.ionicframework.com/u/h3inz)\
**Post date:** [July 22, 2024, 2:06pm UTC](https://forum.ionicframework.com/t/prevent-phaser-from-receiveing-events-through-ion-select-that-opens-on-top-of-it/243234/1 "2024-07-22T14:06:50Z")

</div>

I have a working ion-select and also a working phaser scene but sometimes the ion-select opens on top of the phaser scene and when I select something the click goes through to phaser and a phaser sprite fires an event, which I don’t want to. I have tried both event.stopPropagation and event.preventDefault to alter this.

---

<div class="post-metadata">

**Author:** ![twestrick](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/twestrick/32/136131_2.png) [@twestrick](https://forum.ionicframework.com/u/twestrick)\
**Post date:** [July 22, 2024, 5:59pm UTC](https://forum.ionicframework.com/t/prevent-phaser-from-receiveing-events-through-ion-select-that-opens-on-top-of-it/243234/2 "2024-07-22T17:59:23Z")

</div>

It would be helpful if you shared some code. Are you using a framework (React/Vue/Angular) with Ionic?

---

<div class="post-metadata">

**Author:** ![h3inz](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/h3inz/32/136542_2.png) [@h3inz](https://forum.ionicframework.com/u/h3inz)\
**Post date:** [July 22, 2024, 6:42pm UTC](https://forum.ionicframework.com/t/prevent-phaser-from-receiveing-events-through-ion-select-that-opens-on-top-of-it/243234/3 "2024-07-22T18:42:28Z")

</div>

I am using Angular. As I said everything works otherwise but the ion-select lets events through to phaser, when opening on top of it, although the ion-selects own events are functioning too. The phaser event happens before ion-select so I guess that is the reason that event.stopPropagation and event.preventDefault don’t do anything.  
The files are too long to paste here.

---

<div class="post-metadata">

**Author:** ![twestrick](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/twestrick/32/136131_2.png) [@twestrick](https://forum.ionicframework.com/u/twestrick)\
**Post date:** [July 22, 2024, 6:51pm UTC](https://forum.ionicframework.com/t/prevent-phaser-from-receiveing-events-through-ion-select-that-opens-on-top-of-it/243234/4 "2024-07-22T18:51:41Z")

</div>

> [@h3inz](#):
>
> The phaser event happens before ion-select so I guess that is the reason that event.stopPropagation and event.preventDefault don’t do anything.

Sounds like you figured it out then 😅 Maybe set a flag when `IonSelect` is open and check the flag in the Phaser event.

---

<div class="post-metadata">

**Author:** ![h3inz](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/h3inz/32/136542_2.png) [@h3inz](https://forum.ionicframework.com/u/h3inz)\
**Post date:** [May 24, 2026, 4:05pm UTC](https://forum.ionicframework.com/t/prevent-phaser-from-receiveing-events-through-ion-select-that-opens-on-top-of-it/243234/5 "2026-05-24T16:05:37Z")

</div>

In case someone has the same problem.

Inside phaser config, disable windowEvents:

```auto
			input: {
				windowEvents: false,
			},

```
