diff options
author | Florrie <towerofnix@gmail.com> | 2018-09-12 14:09:46 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-09-12 14:09:46 -0300 |
commit | 9bffe0da811c4ff445348531f66db1559d80fd2d (patch) | |
tree | 2b1957543eef4bd3b338e20ec751e077a37e1792 /ui | |
parent | a4020ad79c4c9f275c960882bfec8bb473d98d9f (diff) |
Add 'cancel' event (on ESC) to TextInput
Diffstat (limited to 'ui')
-rw-r--r-- | ui/form/TextInput.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/form/TextInput.js b/ui/form/TextInput.js index f07b562..766f959 100644 --- a/ui/form/TextInput.js +++ b/ui/form/TextInput.js @@ -68,6 +68,9 @@ module.exports = class TextInput extends FocusElement { } } else if (telc.isEscape(keyBuf)) { // ESC is bad and we don't want that in the text input! + // Also emit a "cancel" event, which doesn't necessarily do anything, + // but can be listened to. + this.emit('cancel') return } else { const isTextInput = keyBuf.toString().split('').every(chr => { |