You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've trapped into the issue when dropdown menu trigger (implemented with radix dropdown menu) click events are not tracked by PostHog Autocapture. The problem is the target value of a click event is always the html root node. So basically click on the Actions button is not tracked by posthog:
// output when clicked on Action button: htmldocument.addEventListener('click',e=>console.log(e.target),true)// output when clicked on Action button: <span class="..."> -- button child elementdocument.addEventListener('pointerdown',e=>console.log(e.target),true)
Solution
The solution to this is to track pointerdown events as described in this radix discussion: radix-ui/primitives#2264 (reply in thread)
ChatGPT outlined the root problem very well:
Is there a way to add an option to change click to pointerdown event on PostHog init?
The text was updated successfully, but these errors were encountered:
The problem
I've trapped into the issue when dropdown menu trigger (implemented with radix dropdown menu) click events are not tracked by PostHog Autocapture. The problem is the target value of a click event is always the
html
root node. So basically click on theActions
button is not tracked by posthog:Reproduction
Solution
The solution to this is to track
pointerdown
events as described in this radix discussion: radix-ui/primitives#2264 (reply in thread)ChatGPT outlined the root problem very well:
Is there a way to add an option to change
click
topointerdown
event on PostHog init?The text was updated successfully, but these errors were encountered: