Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Events are firing twice when we have dynamic and static mode #10441

Open
danielbarion opened this issue Apr 11, 2024 · 3 comments
Open

Bug: Events are firing twice when we have dynamic and static mode #10441

danielbarion opened this issue Apr 11, 2024 · 3 comments
Assignees
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release.

Comments

@danielbarion
Copy link
Contributor

danielbarion commented Apr 11, 2024

Current Behavior

When we have eventMode = 'static' and eventMode = 'dynamic' in the same app, the events fire twice.

Expected Behavior

When we have eventMode = 'static' and eventMode = 'dynamic' in the same app, the events should fire only once.

Steps to Reproduce

  1. Go to https://pixijs.com/8.x/playground?exampleId=events.logger
  2. On the following code:
    // Enable interactivity everywhere!
    app.stage.eventMode = 'static';
    app.stage.hitArea = app.screen;
    whiteBox.eventMode = 'static';
    blackBox.eventMode = 'static';
  1. Change any of the event modes to be dynamic:
    // Enable interactivity everywhere!
    app.stage.eventMode = 'static';
    app.stage.hitArea = app.screen;
    whiteBox.eventMode = 'dynamic';
    blackBox.eventMode = 'static';

Wait it gets reflected into the playground, the events are now firing twice.

The playground already edited

Another simple example: https://www.pixiplayground.com/#/edit/exDzbrsXsLvgdbWm0iZFG

Environment

Possible Solution

No response

Additional Information

No response

@Zyie Zyie self-assigned this Apr 12, 2024
@Zyie Zyie added the 🕷 Bug Verified that it’s actually a legit bug that exists in the current release. label May 23, 2024
@CatchABus
Copy link

The root cause seems to be here: https://github.com/pixijs/pixijs/blob/dev/src/events/EventTicker.ts#L110
That dispatch might need better handling.

@Nantris
Copy link

Nantris commented Jun 5, 2024

Great find @CatchABus.

@danielbarion is this not a duplicate of #10131. If it is, I'd encourage you to close this one and join us in discussion over there, but I understand it may be a distinct (albeit related) issue.

@danielbarion
Copy link
Contributor Author

@Nantris I saw on the issue you mentioned the following: The issue occurs about 90% of the time..

Here the issue happens 100% of the time when we have static event mode and dynamic in the same scenario/app.

I had the issue and a friend from Pixi.js team identified the issue, he asked me to create this issue so the team can work on it when they have time.

So I believe it's better to keep this one open and let the team close it, thanks for sharing the other issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release.
Projects
None yet
Development

No branches or pull requests

4 participants