From 8bac3888a8c9517009bc196c91d4173c70d201ea Mon Sep 17 00:00:00 2001 From: yonmey Date: Fri, 23 Mar 2018 17:35:09 +0100 Subject: [PATCH 1/2] Fix - keypress event to keydown changed --- src/keyboard.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/keyboard.vue b/src/keyboard.vue index f56d4cf..153bdae 100644 --- a/src/keyboard.vue +++ b/src/keyboard.vue @@ -233,7 +233,7 @@ if (this.input.maxLength <= 0 || text.length < this.input.maxLength) { if (this.options.useKbEvents) { let e = document.createEvent("Event"); - e.initEvent("keypress", true, true); + e.initEvent("keydown", true, true); e.which = e.keyCode = addChar.charCodeAt(); if (this.input.dispatchEvent(e)) { text = this.insertChar(caret, text, addChar); From 29ab934f8813d9912f4a330dd32faac39be79c72 Mon Sep 17 00:00:00 2001 From: yonmey Date: Mon, 26 Mar 2018 10:30:38 +0200 Subject: [PATCH 2/2] keypress event to keydown updated --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index be8e0e2..1e6f18e 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Property | Default | Accepted values | Description ## Options Option | Default | Accepted values | Description ----------- | -------- | --------------- | ----------- -`useKbEvents` | `false` | `boolean` | If true, the component will generate a `keypress` event and trigger it. If it returns with `false`, it won't insert the new character. +`useKbEvents` | `false` | `boolean` | If true, the component will generate a `keydown` event and trigger it. If it returns with `false`, it won't insert the new character. ## Built-in layouts * `normal` - Normal full layout. Similar as real keyboard layouts