phaserjs / phaserjs/phaser

`Phaser.Input.Pointer.leftButtonReleased` returns true for pointerdown events

Open
#7,254 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
40.3k
Forks
7.2k
PR merge metrics
No merged PRs in 30d

Description

Version

  • Phaser Version: 3.85.0 - 4.0.0 RC6
  • Operating system: all
  • Browser: all

Description

When clicking with the left mouse button, Phaser.Input.Pointer.leftButtonReleased returns true for pointerdown events.
The change in ef6a9331b6b5ca94cb2f8259feeac3ce4fb47ba4 added a conditional assignment that is incorrect.

return this.buttons === 0 ? (this.button === 0 && !this.isDown) : this.button === 0;

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the implementation of Phaser.Input.Pointer.leftButtonReleased and the change introduced by commit ef6a9331b6b5ca94cb2f8259feeac3ce4fb47ba. Reproduce a left-button pointerdown event and verify that leftButtonReleased is false there, while the corrected behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
game-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.