-
Notifications
You must be signed in to change notification settings - Fork 121
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: dead click detection #1463
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size Change: +40.3 kB (+1.42%) Total Size: 2.87 MB
ℹ️ View Unchanged
|
import { uuidv7 } from '../../uuidv7' | ||
import { DeadClicksAutocapture } from '../../extensions/dead-clicks-autocapture' | ||
|
||
describe('DeadClicksAutocapture', () => { |
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 outer wrapper delegates entirely to the lazy loaded one so we can test it interacts with a mock as desired and ignore the behaviour
@@ -37,6 +37,202 @@ function limitText(length: number, text: string): string { | |||
return text | |||
} | |||
|
|||
export function getAugmentPropertiesFromElement(elem: Element): Properties { |
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.
a bunch of functions move out of the class so we can use them directly because they (mostly) don't rely on state of the class
it should help with bundle size a tiny bit since the names are now minifiable
Does selecting text trigger this? It's not a dom mutation or a scroll, but it's not dead either |
@robbie-c you get 2 hedgehog points for spotting that! fix incoming |
|
||
export function getPropertiesFromElement( | ||
elem: Element, | ||
maskAllAttributes: boolean, |
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.
renamed this parameter which has always been wrong
Related to text selection, I guess any interaction with form elements (e.g. clicking a select input) wouldn't change the dom but isn't dead either |
fair point... made any autocapturable element not eligible for dead click detection |
We autocapture valid webpage interactions
But some people will want to autocapture invalid interactions
for example in some places in posthog these "i" icons are clickable in others they aren't
deadclick autocapture lets you detect clicks that are not followed by scroll or DOM mutation, so you can see if folk are clicking things thinking something will happen and nothing happens
## Needs