diff --git a/package-lock.json b/package-lock.json index f7672131..7bcf101e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "simple-keyboard", - "version": "2.20.5", + "version": "2.20.7", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -12567,7 +12567,8 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", @@ -12578,7 +12579,8 @@ "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -12695,7 +12697,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -12707,6 +12710,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -12729,12 +12733,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -12753,6 +12759,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -12833,7 +12840,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -12845,6 +12853,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -12966,6 +12975,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/package.json b/package.json index 727d0130..67a2ebb2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-keyboard", - "version": "2.20.6", + "version": "2.20.7", "description": "On-screen Javascript Virtual Keyboard", "main": "build/index.js", "types": "build/index.d.ts", diff --git a/src/lib/components/Keyboard.js b/src/lib/components/Keyboard.js index a2c3bf8a..64f5e398 100644 --- a/src/lib/components/Keyboard.js +++ b/src/lib/components/Keyboard.js @@ -1158,9 +1158,25 @@ class SimpleKeyboard { this.initialized = true; /** - * Handling mouseup + * Handling onpointerup */ - if (!useTouchEvents) { + /* istanbul ignore next */ + if ( + this.utilities.pointerEventsSupported() && + !useTouchEvents && + !useMouseEvents + ) { + document.onpointerup = () => this.handleButtonMouseUp(); + } else if (useTouchEvents) { + /** + * Handling ontouchend, ontouchcancel + */ + document.ontouchend = e => this.handleButtonMouseUp(); + document.ontouchcancel = e => this.handleButtonMouseUp(); + } else if (!useTouchEvents) { + /** + * Handling mouseup + */ document.onmouseup = () => this.handleButtonMouseUp(); }