Fix mouseHold for preventMouseDownDefault

This commit is contained in:
Francisco Hodge
2019-04-18 09:01:22 -04:00
parent f9881d3cc7
commit 194c60c6c9
3 changed files with 35 additions and 9 deletions
+18 -2
View File
@@ -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();
}