Skip to content

Commit

Permalink
bind keypress envent on root div instead of window object
Browse files Browse the repository at this point in the history
  • Loading branch information
jparez committed Mar 18, 2024
1 parent e4866ca commit f6788e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugins/KeyboardEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module.exports = class KeyboardEvents {
* @param {Event} event Event.
*/
onKeyPress(event) {
if (!this.transmitKeys) {
if (!this.transmitKeys) {

Check failure on line 98 in src/plugins/KeyboardEvents.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 8 spaces but found 16
return;
}
const key = event.charCode;
Expand Down Expand Up @@ -221,7 +221,7 @@ module.exports = class KeyboardEvents {
addKeyboardCallbacks() {
this.instance.root.tabIndex = 0;

if (!this.isListenerAdded) {
if (!this.isListenerAdded) {

Check failure on line 224 in src/plugins/KeyboardEvents.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 8 spaces but found 16
// This avoid having continuously pressed keys because of alt+tab or any other command that blur from tab
this.removeBlurListener = this.instance.addListener(window, 'blur', this.cancelAllPressedKeys.bind(this));

Expand All @@ -234,7 +234,7 @@ module.exports = class KeyboardEvents {
}
this.instance.root.focus();
this.keyboardCallbacks.forEach((item, index, array) => {
array[index].removeListener = this.instance.addListener(window, item.event, item.handler);
array[index].removeListener = this.instance.addListener(this.instance.root, item.event, item.handler);
});
this.isListenerAdded = true;
}
Expand Down

0 comments on commit f6788e3

Please sign in to comment.