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){
|
caretEventHandler(event){
|
||||||
let targetTagName;
|
let targetTagName;
|
||||||
|
|
||||||
|
if(this.isMouseHold){
|
||||||
|
this.isMouseHold = false;
|
||||||
|
}
|
||||||
|
|
||||||
if(event.target.tagName){
|
if(event.target.tagName){
|
||||||
targetTagName = event.target.tagName.toLowerCase();
|
targetTagName = event.target.tagName.toLowerCase();
|
||||||
}
|
}
|
||||||
@ -767,19 +771,19 @@ class SimpleKeyboard {
|
|||||||
*/
|
*/
|
||||||
this.onRender();
|
this.onRender();
|
||||||
|
|
||||||
/**
|
|
||||||
* Handling mouseup
|
|
||||||
*/
|
|
||||||
if (!useTouchEvents) {
|
|
||||||
document.onmouseup = () => this.handleButtonMouseUp();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!this.initialized){
|
if(!this.initialized){
|
||||||
/**
|
/**
|
||||||
* Ensures that onInit is only called once per instantiation
|
* Ensures that onInit is only called once per instantiation
|
||||||
*/
|
*/
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handling mouseup
|
||||||
|
*/
|
||||||
|
if (!useTouchEvents) {
|
||||||
|
document.onmouseup = () => this.handleButtonMouseUp();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calling onInit
|
* Calling onInit
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user