Skip to content

Commit 5d58a0f

Browse files
irenehakesmatus-tomlein
authored andcommitted
Pass clicked element to dynamic context functions for button click tracking plugin (close #1368)
PR #1389
1 parent 34168d0 commit 5d58a0f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@snowplow/browser-plugin-button-click-tracking",
5+
"comment": "Pass clicked element to dynamic context functions for button click tracking plugin (#1368)",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@snowplow/browser-plugin-button-click-tracking"
10+
}

plugins/browser-plugin-button-click-tracking/src/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function eventHandler(event: MouseEvent, trackerId: string, filter: FilterFuncti
102102
if (elem instanceof HTMLButtonElement || (elem instanceof HTMLInputElement && elem.type === 'button')) {
103103
if (filter(elem)) {
104104
const buttonClickEvent = createEventFromButton(elem);
105-
buttonClickEvent.context = resolveDynamicContext(context, buttonClickEvent);
105+
buttonClickEvent.context = resolveDynamicContext(context, buttonClickEvent, elem);
106106
trackButtonClick(buttonClickEvent, [trackerId]);
107107
}
108108
// presume nested buttons aren't a thing

0 commit comments

Comments
 (0)