Skip to content

Fix leftButtonReleased reporting presses as releases - #7367

Open
ICOM725 wants to merge 1 commit into
phaserjs:masterfrom
ICOM725:fix/pointer-left-release
Open

Fix leftButtonReleased reporting presses as releases#7367
ICOM725 wants to merge 1 commit into
phaserjs:masterfrom
ICOM725:fix/pointer-left-release

Conversation

@ICOM725

@ICOM725 ICOM725 commented Sep 7, 2026

Copy link
Copy Markdown

This PR

  • Fixes a bug

Describe the changes below:

leftButtonReleased() currently returns true on a left-button press because its nonzero buttons branch only checks button. Check that the left button is no longer held in that branch, while preserving release detection when another mouse button remains pressed.

Adds seven tests covering left-button presses and releases, left/right button combinations, releases of another button, and touch start/end.

Fixes #7254.

Verification:

  • Before the fix, three new tests failed: left-button press, left-button press while holding right, and touch start.
  • npm test -- tests/input --maxWorkers=2: 24 files and 656 tests passed.
  • npm run build: webpack compiled successfully; the copy-to-examples step reported that the sibling examples directory was absent.
  • npm run lint could not load the repository's legacy JSON config with ESLint 10 (ERR_IMPORT_ATTRIBUTE_MISSING). Targeted ESLint 8 checking found one pre-existing lines-around-comment error in Pointer.test.js; the same check passed with that rule disabled.
  • git diff --check passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant