Browse Source

Submit file using enter key (#130)

KeyboardEvent.charCode is deprechated. Used KeyboardEvent.key instead.

Fixes #122.
IndianaDschones 8 years ago
parent
commit
d13858eccd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/partials/messenger.ts

+ 1 - 1
src/partials/messenger.ts

@@ -69,7 +69,7 @@ class SendFileController extends DialogController {
     }
 
     public keypress($event: KeyboardEvent): void {
-        if ($event.charCode === 13) { // Enter
+        if ($event.key === 'Enter') { // see https://developer.mozilla.org/de/docs/Web/API/KeyboardEvent/key/Key_Values
             this.send();
         }
     }