git ssb

16+

Dominic / patchbay



Commit 27820b1aee3f1d61037093bbfbaff982aae6feba

add shortcut: esc = blur for text fields

mix irving committed on 9/10/2017, 11:58:11 PM
Parent: 0912ef5f2f38dca853b2292f79efa2857cf6bf16

Files changed

app/sync/catch-keyboard-shortcut.jschanged
app/sync/catch-keyboard-shortcut.jsView
@@ -31,10 +31,16 @@
3131 return (tag === 'INPUT' || tag === 'TEXTAREA')
3232 }
3333
3434 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()
3743 }
3844 }
3945
4046 function genericShortcuts (ev, { tabs, search, goTo }) {

Built with git-ssb-web