mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2025-04-15 21:57:09 +08:00
Set PhysicalKeyboardHighlight pointerup appropriately. Per #1506
This commit is contained in:
parent
a111940488
commit
d2c7a2fda7
@ -55,7 +55,6 @@ class PhysicalKeyboard {
|
|||||||
if (options.physicalKeyboardHighlightPress) {
|
if (options.physicalKeyboardHighlightPress) {
|
||||||
if (options.physicalKeyboardHighlightPressUsePointerEvents) {
|
if (options.physicalKeyboardHighlightPressUsePointerEvents) {
|
||||||
buttonDOM.onpointerdown();
|
buttonDOM.onpointerdown();
|
||||||
buttonDOM.onpointerup();
|
|
||||||
} else if (options.physicalKeyboardHighlightPressUseClick) {
|
} else if (options.physicalKeyboardHighlightPressUseClick) {
|
||||||
buttonDOM.click();
|
buttonDOM.click();
|
||||||
} else {
|
} else {
|
||||||
@ -67,6 +66,7 @@ class PhysicalKeyboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleHighlightKeyUp(event: KeyboardEvent) {
|
handleHighlightKeyUp(event: KeyboardEvent) {
|
||||||
|
const options = this.getOptions();
|
||||||
const buttonPressed = this.getSimpleKeyboardLayoutKey(event);
|
const buttonPressed = this.getSimpleKeyboardLayoutKey(event);
|
||||||
|
|
||||||
this.dispatch((instance: any) => {
|
this.dispatch((instance: any) => {
|
||||||
@ -76,6 +76,9 @@ class PhysicalKeyboard {
|
|||||||
|
|
||||||
if (buttonDOM && buttonDOM.removeAttribute) {
|
if (buttonDOM && buttonDOM.removeAttribute) {
|
||||||
buttonDOM.removeAttribute("style");
|
buttonDOM.removeAttribute("style");
|
||||||
|
if (options.physicalKeyboardHighlightPressUsePointerEvents) {
|
||||||
|
buttonDOM.onpointerup();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user