Fix buttonHold issue

This commit is contained in:
Francisco Hodge 2018-11-19 09:29:49 -05:00
parent 366f4cd98e
commit d38433be1c

View File

@ -519,6 +519,10 @@ class SimpleKeyboard {
caretEventHandler(event){
let targetTagName;
if(this.isMouseHold){
this.isMouseHold = false;
}
if(event.target.tagName){
targetTagName = event.target.tagName.toLowerCase();
}
@ -767,19 +771,19 @@ class SimpleKeyboard {
*/
this.onRender();
/**
* Handling mouseup
*/
if (!useTouchEvents) {
document.onmouseup = () => this.handleButtonMouseUp();
}
if(!this.initialized){
/**
* Ensures that onInit is only called once per instantiation
*/
this.initialized = true;
/**
* Handling mouseup
*/
if (!useTouchEvents) {
document.onmouseup = () => this.handleButtonMouseUp();
}
/**
* Calling onInit
*/