Meteor 1.2.0.2. event target error for css classes


#1

I just upgraded meteor and now when I try to target a css class (i.e.

“click .toggle-checked”: function(event){
Todos.update(this._id, {$set:{checked: ! this.checked}});
},
“click .deletethis”: function(event) {
Todos.remove(this._id);
}
) anything clicked in the li container deletes the record. Without the deletethis, clicking anywhere in the li clicks the check box as well.

When I change the targeted elements from classes to id’s, it works.


#2

You probably want to return false; from your event handlers to stop event bubbling:

Returning false from a handler is the same as calling both stopImmediatePropagation and preventDefault on the event.


#3

Thanks.
That makes sense.
Gone a couple days so i’ll give it a try when I get back.

Thanks again,
Phil