Skip to content

Commit

Permalink
Pointer.stop would call event.preventDefault if `Pointer._stateRese…
Browse files Browse the repository at this point in the history
…t` was `true`, which is always `true` after a State has changed and before Pointer.start has been called. However this broken interacting with DOM elements in the case where the State changes and you immediately try to use the DOM element without first having clicked on the Phaser game. An additional guard was added so `preventDefault` will now only be called if both `_stateReste` and `Pointer.withinGame` are true (thanks @satan6 #1509)
  • Loading branch information
photonstorm committed Feb 11, 2015
1 parent 42c75c0 commit aa2df80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Thanks to @pnstickne for vast majority of this update.
* ArcadePhysics.moveToPointer no longer goes crazy if the maxTime parameter is given and the Sprite is positioned in a larger game world (thanks @AnderbergE #1472)
* Sound.loop even when set for WebAudio wouldn't use the AudioContext loop property because Sound.start was being invoked with an offset and duration. Now if `loop` is true and no marker is being used it will use the native Web Audio loop support (#1431)
* Timer.update was calling the TimerEvent callback even if `TimerEvent.pendingDelete` was already set to `true`, causing timer events to stack-up in cases where a new TimerEvent was generated in the callback (thanks @clowerweb #838)
* Pointer.stop would call `event.preventDefault` if `Pointer._stateReset` was `true`, which is always `true` after a State has changed and before Pointer.start has been called. However this broken interacting with DOM elements in the case where the State changes and you immediately try to use the DOM element without first having clicked on the Phaser game. An additional guard was added so `preventDefault` will now only be called if both `_stateReste` and `Pointer.withinGame` are true (thanks @satan6 #1509)

For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).

Expand Down
2 changes: 1 addition & 1 deletion src/input/Pointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ Phaser.Pointer.prototype = {
*/
stop: function (event) {

if (this._stateReset)
if (this._stateReset && this.withinGame)
{
event.preventDefault();
return;
Expand Down

0 comments on commit aa2df80

Please sign in to comment.