Record pointerType on clicks - could be useful for displaying e.g. a 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
This commit is contained in:
@@ -404,6 +404,7 @@ type mouseInteractionParam = {
|
||||
id: number;
|
||||
x: number;
|
||||
y: number;
|
||||
pointerType?: string;
|
||||
};
|
||||
|
||||
export type mouseInteractionCallBack = (d: mouseInteractionParam) => void;
|
||||
|
||||
Reference in New Issue
Block a user