Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/input/InputManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,12 @@ var InputManager = new Class({

if (pointer.active && pointer.identifier === changedTouch.identifier)
{
var element = document.elementFromPoint(changedTouch.clientX, changedTouch.clientY);
// Use the canvas's root node (a ShadowRoot when Phaser runs inside shadow DOM,
// otherwise the Document) so over-canvas detection pierces shadow boundaries.
// document.elementFromPoint does not, returning the shadow host instead, which made
// isOver latch false and silently dropped every touch move inside a shadow root.
var inputRoot = this.canvas ? this.canvas.getRootNode() : null;
var element = (inputRoot && inputRoot.elementFromPoint ? inputRoot : document).elementFromPoint(changedTouch.clientX, changedTouch.clientY);
var overCanvas = element === this.canvas;

if (!this.isOver && overCanvas)
Expand Down