mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2025-01-19 16:52:59 +08:00
Fix buttonHold issue
This commit is contained in:
parent
366f4cd98e
commit
d38433be1c
@ -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,6 +771,12 @@ class SimpleKeyboard {
|
||||
*/
|
||||
this.onRender();
|
||||
|
||||
if(!this.initialized){
|
||||
/**
|
||||
* Ensures that onInit is only called once per instantiation
|
||||
*/
|
||||
this.initialized = true;
|
||||
|
||||
/**
|
||||
* Handling mouseup
|
||||
*/
|
||||
@ -774,12 +784,6 @@ class SimpleKeyboard {
|
||||
document.onmouseup = () => this.handleButtonMouseUp();
|
||||
}
|
||||
|
||||
if(!this.initialized){
|
||||
/**
|
||||
* Ensures that onInit is only called once per instantiation
|
||||
*/
|
||||
this.initialized = true;
|
||||
|
||||
/**
|
||||
* Calling onInit
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user