mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 22:18:29 +00:00
Modified onMouseUpWindow
and onMouseDownWindow
in the MouseManager
so they now check for sourceCapabilities.firesTouchEvents
and if found, abort registering the event. This new browser event property is designed to prevent you accidentally registering a Mouse Event when a Touch Event has just occurred (see https://developer.mozilla.org/en-US/docs/Web/API/InputDeviceCapabilities/firesTouchEvents) #6747
This commit is contained in:
parent
fb47fcf455
commit
229f9232f4
1 changed files with 10 additions and 0 deletions
|
@ -397,6 +397,11 @@ var MouseManager = new Class({
|
|||
|
||||
this.onMouseDownWindow = function (event)
|
||||
{
|
||||
if (event.sourceCapabilities && event.sourceCapabilities.firesTouchEvents)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!event.defaultPrevented && _this.enabled && manager && manager.enabled && event.target !== canvas)
|
||||
{
|
||||
// Only process the event if the target isn't the canvas
|
||||
|
@ -419,6 +424,11 @@ var MouseManager = new Class({
|
|||
|
||||
this.onMouseUpWindow = function (event)
|
||||
{
|
||||
if (event.sourceCapabilities && event.sourceCapabilities.firesTouchEvents)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!event.defaultPrevented && _this.enabled && manager && manager.enabled && event.target !== canvas)
|
||||
{
|
||||
// Only process the event if the target isn't the canvas
|
||||
|
|
Loading…
Add table
Reference in a new issue