site: fix enter handling in animate example

pull/2772/head
Conduitry 6 years ago
parent 66e39d52d4
commit 3cfbd66841

@ -44,12 +44,6 @@
function remove(todo) { function remove(todo) {
todos = todos.filter(t => t !== todo); todos = todos.filter(t => t !== todo);
} }
function handleKeydown(event) {
if (event.which === 13) {
addTodo(event.target);
}
}
</script> </script>
<style> <style>
@ -115,7 +109,7 @@
</style> </style>
<div class='board'> <div class='board'>
<input class="new-todo" placeholder="what needs to be done?" on:enter={add}> <input class="new-todo" placeholder="what needs to be done?" on:keydown="{event => event.which === 13 && add(this)}">
<div class='left'> <div class='left'>
<h2>todo</h2> <h2>todo</h2>

Loading…
Cancel
Save