Hi, I posted this on Stack over flow and no one manages to help succesfully and I cant solve this issue in my app
I have comments and within those comments I have a button “reply” when I click on reply the form to leave an additional comment will open.
The problem is that when I click on a reply button it opens the form on all the other comments as well as the one clicked instead of only where I clicked.
yes , this is the seletor of the reply button (a page with many comments can have many reply buttons) so how can I make so when I click on it only the one I clicked shows instead of all the reply buttons with selector $(".commentToShow")
@shock is (pretty much) spot on! Just one small correction:
Explanation of correction applied to @shock’s code: this is bound to the current data context, not to the current template. That’d be true for onRendered or onCreated handlers, but in events and helpers this is the current data context. That part of Blaze is a bit less consistent than ideal, so it can trip you up. But other than that… spot on!
EDIT: And so, just to be 100% complete and precise: This problem that you have/had, @hodaraadam, was not about event bubbling, but instead about a too general element selector for your show() call, which is solved by using the template-scoped jQuery instance instead of the regular global one!