Commit 27820b1aee3f1d61037093bbfbaff982aae6feba
add shortcut: esc = blur for text fields
mix irving committed on 9/10/2017, 11:58:11 PMParent: 0912ef5f2f38dca853b2292f79efa2857cf6bf16
Files changed
app/sync/catch-keyboard-shortcut.js | changed |
app/sync/catch-keyboard-shortcut.js | ||
---|---|---|
@@ -31,10 +31,16 @@ | ||
31 | 31 … | return (tag === 'INPUT' || tag === 'TEXTAREA') |
32 | 32 … | } |
33 | 33 … | |
34 | 34 … | function textFieldShortcuts (ev) { |
35 | - if (ev.keyCode === 13 && ev.ctrlKey) { | |
36 | - ev.target.publish() // expects the textField to have a publish method | |
35 … | + switch (ev.keyCode) { | |
36 … | + case 13: // ctrl+enter | |
37 … | + if (ev.ctrlKey) { | |
38 … | + ev.target.publish() // expects the textField to have a publish method | |
39 … | + } | |
40 … | + return | |
41 … | + case 27: // esc | |
42 … | + return ev.target.blur() | |
37 | 43 … | } |
38 | 44 … | } |
39 | 45 … | |
40 | 46 … | function genericShortcuts (ev, { tabs, search, goTo }) { |
Built with git-ssb-web