-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Record pointerType on clicks #1129
Conversation
🦋 Changeset detectedLatest commit: be85644 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
You have some typescript typing that needs changing, and then a bunch of tests will need to be updated. But this is a welcome addition to rrweb IMO! |
…circle rather than a point during replay - We have to switch to 'onpointerdown' & 'onpointerup' in order to actually capture `e.pointerType` - this replaces 4 event listeners (MouseDown/MouseUp/TouchStart/TouchEnd) with 2 pointer ones which should fire in all 4 scenarios. We still output the old types according to the MouseInteractions enum - there is no Pointer equivalent of Click, so we leave that is, but use the last Pointer event to attach a pointerType to (only) the click event, where it is most useful - we can fallback to the old method for any browsers not supporting `window.PointerEvent`, in which case \`pointerType\` will be absent from all events
ff99f46
to
351c555
Compare
@Juice10 I'm deploying the changes to a 'canary' test environment so feel free to merge in a few weeks if I haven't done so by then (will be away over Easter hols) |
@Juice10 any idea why
|
Another observation: A touch event is showing up as 'mouse' with this new code. On the same laptop, Chromium works as expected and records these events as 'touch'. |
I guess it could be because our version of Puppeteer doesn't support PointerType? |
@eoghanmurray the setup is mostly the same. Big difference is that click events in puppeteer aren't 100% the same as "real" click events. From the puppeteer docs:
|
@eoghanmurray would you like to merge this one or wait till you get the tests dialed in? |
I've gone ahead and merged; if we change up from Puppeteer in future it should be discoverable what the correct |
touchscreen laptops can have both mouse and touch within the same session