Skip to content

Commit 46379fe

Browse files
authored
fix ui.save not detect escape key
change event from onkeypress to onkeyup because onkeypress cannot detect escape key press if (e.keyCode === 27)
1 parent 516d6f2 commit 46379fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

todomvc/todomvc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ var Todos = {
104104
m("label", {ondblclick: function() {state.dispatch("edit", [todo])}}, todo.title),
105105
m("button.destroy", {onclick: function() {state.dispatch("destroy", [todo])}}),
106106
]),
107-
m("input.edit", {onupdate: function(vnode) {ui.focus(vnode, todo)}, onkeypress: ui.save, onblur: ui.save})
107+
m("input.edit", {onupdate: function(vnode) {ui.focus(vnode, todo)}, onkeyup: ui.save, onblur: ui.save})
108108
])
109109
}),
110110
]),

0 commit comments

Comments
 (0)