-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: deadclicks in heatmaps #1510
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size Change: +4.78 kB (+0.16%) Total Size: 3.01 MB
ℹ️ View Unchanged
|
|
||
export function isElementInToolbar(el: Element): boolean { | ||
// NOTE: .closest is not supported in IE11 hence the operator check | ||
return el.id === TOOLBAR_ID || !!el.closest?.('#' + TOOLBAR_ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was only working previously by accident because there is also ph-no-capture
which autocapture obeys
closest
does not escape shadow roots and TOOLBAR_ID is outside the shadow root.
switched to a selector inside the shadow root (the selector provided is at the root of the toolbar inside the shadow root
e.g.
<div id="TOOLBAR_ID">
<shadow_root>
<div class=TOOLBAR_CONTAINER_CLASS>
we want to allow deadclicks collection in heatmaps
it gives you less information but doesn't cost money, folk that want more information can turn on standalone deadclicks capture
to keep things loose the heatmap starts its own instance of deadclicks capture, deadclicks was altered to receive varying behviour by constructor injection
running locally I can capture deadclicks correctly with both deadclicks and heatmaps enabled or either one enabled