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:
Richard Davey 2024-02-27 15:36:23 +00:00
parent fb47fcf455
commit 229f9232f4

View file

@ -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