Skip to content

Commit

Permalink
fix(ui): Check event cancelable before event.preventDefault (#4690)
Browse files Browse the repository at this point in the history
This error occurs when the first touch is initiated:

[Intervention] Ignored attempt to cancel a touchstart event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.

Added logic to confirm that the error can be cancelled before event.preventDefault.
  • Loading branch information
ocipap authored and joeyparrish committed Dec 8, 2022
1 parent ad41cf4 commit 7a3e66d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
// The controls are hidden, so show them.
this.onMouseMove_(event);
// Stop this event from becoming a click event.
event.preventDefault();
event.cancelable && event.preventDefault();
}
}

Expand Down

0 comments on commit 7a3e66d

Please sign in to comment.