Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 0400eef

Browse files
committed
Subscribe onChange instead of onClick of input element
1 parent a2841b6 commit 0400eef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

example/todos/app/components/todo_item.react.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def finish_editing
2424
def render
2525
li(class_name: {editing: self.editing}) do
2626
div(class_name: 'view') do
27-
input(class_name: "toggle", type: "checkbox", checked: params[:todo].completed).on(:click) do
27+
input(class_name: "toggle", type: "checkbox", checked: params[:todo].completed)
28+
.on(:change) do |e|
2829
todo = params[:todo]
2930
todo.update(:completed => !todo.completed)
3031
end

0 commit comments

Comments
 (0)