mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2026-05-19 00:00:07 +08:00
Merge pull request #2545 from joeybones/check-target-classlist
Add undefined check to oncontextmenu handler
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user