Merge pull request #2545 from joeybones/check-target-classlist

Add undefined check to oncontextmenu handler
This commit is contained in:
Francisco Hodge
2025-06-03 11:43:06 -04:00
committed by GitHub
+1 -1
View File
@@ -1496,7 +1496,7 @@ class SimpleKeyboard {
/* istanbul ignore next */
disableContextualWindow() {
window.oncontextmenu = (event: KeyboardHandlerEvent) => {
if (event.target.classList.contains("hg-button")) {
if (event.target.classList?.contains("hg-button")) {
event.preventDefault();
event.stopPropagation();
return false;