Listen to pointerdown
events instead of click
in Autocapture to track dropdown menus target properly
#1526
Labels
SDK Support
General SDK issues rather than being related to a feature team
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: