Set PhysicalKeyboardHighlight pointerup appropriately. Per #1506

This commit is contained in:
Francisco Hodge 2022-04-14 22:37:03 -07:00
parent a111940488
commit d2c7a2fda7

View File

@ -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();
}
} }
}); });
} }