[Solved] Click handling is super weird, false clicks?

What’s going on here? This has plagued me for a while and is super annoying.

Notice this one is NULL – because I clicked on a


within the button, which doesnt have data to pass.

WHY is this being called? Because the parent has an action? :sa:

	'click .uiActionPropertyModal'(event){
		const target = event.target;
		Modal.show('reportPropertyModal', function () {
			window.thePropertyId = target.getAttribute('data-propertyId');
			//return Cases.findOne(target.getAttribute('data-id'));
									<div class="panel-body" >
										<div class="col-md-3">
											<a href="/project/{{_id}}" class="btn btn-info btn-block uiActionPropertyModal" data-propertyId="{{_id}}" style="{{getPropertyStatusCss}}">
										<div class="col-md-3">
											<p>Status: {{status}}</p>
											<p>Created: <time class="text-muted timeago" datetime="{{timeAgoCreated}}">{{timeAgoCreated}}</time></p>
											<p>Updated: <time class="text-muted timeago" datetime="{{timeAgoUpdated}}">{{timeAgoUpdated}}</time></p>
											<p>Risk Rating: {{riskRating}}</p>
											<p>Rating: {{riskRating}}</p>
											<p>Comments: {{overallComments}}</p>

Use event.currentTarget

event.target is the element that was clicked on, while currentTarget is the one that matches the click handler:

1 Like

Thaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaank you.

1 Like

It’s nice when there’s a simple solution! :smiley:


Thanks! I can verify this was infact the solution. You rock dude, thanks. My software is so close to bug free.

These are the little quirks of Meteor that make it kinda hard to get in to. But obvious once you find it. Learning curves…

This one was a plain old browser DOM quirk! You’d get the same behaviour with any framework

But yeah there’s so many quirks with Meteor, Javascript and the DOM that it’s a lot to deal with haha

Understood and agreed.