diff --git a/packages/core/test/specHelper.ts b/packages/core/test/specHelper.ts index f31818026e..a5ecc57553 100644 --- a/packages/core/test/specHelper.ts +++ b/packages/core/test/specHelper.ts @@ -329,6 +329,10 @@ class StubXhr extends StubEventEmitter { } export function createNewEvent
>(eventName: 'click', properties?: P): MouseEvent & P +export function createNewEvent
>(
+ eventName: 'pointerup',
+ properties?: P
+): PointerEvent & P
export function createNewEvent(eventName: string, properties?: { [name: string]: unknown }): Event
export function createNewEvent(eventName: string, properties: { [name: string]: unknown } = {}) {
let event: Event
diff --git a/packages/rum-core/src/domain/rumEventsCollection/action/actionCollection.spec.ts b/packages/rum-core/src/domain/rumEventsCollection/action/actionCollection.spec.ts
index c7203b3459..5c2700d680 100644
--- a/packages/rum-core/src/domain/rumEventsCollection/action/actionCollection.spec.ts
+++ b/packages/rum-core/src/domain/rumEventsCollection/action/actionCollection.spec.ts
@@ -26,7 +26,7 @@ describe('actionCollection', () => {
it('should create action from auto action', () => {
const { lifeCycle, rawRumEvents } = setupBuilder.build()
- const event = createNewEvent('click', { target: document.createElement('button') })
+ const event = createNewEvent('pointerup', { target: document.createElement('button') })
lifeCycle.notify(LifeCycleEventType.AUTO_ACTION_COMPLETED, {
counts: {
errorCount: 10,
diff --git a/packages/rum-core/src/domain/rumEventsCollection/action/listenActionEvents.spec.ts b/packages/rum-core/src/domain/rumEventsCollection/action/listenActionEvents.spec.ts
index 95091d6f27..4314a8aa31 100644
--- a/packages/rum-core/src/domain/rumEventsCollection/action/listenActionEvents.spec.ts
+++ b/packages/rum-core/src/domain/rumEventsCollection/action/listenActionEvents.spec.ts
@@ -1,4 +1,3 @@
-import { resetExperimentalFeatures, updateExperimentalFeatures } from '@datadog/browser-core'
import type { Clock } from '../../../../../core/test/specHelper'
import { createNewEvent, mockClock } from '../../../../../core/test/specHelper'
import type { ActionEventsHooks } from './listenActionEvents'
@@ -37,22 +36,11 @@ describe('listenActionEvents', () => {
expect(actionEventsHooks.onPointerDown).toHaveBeenCalledTimes(1)
})
- it('listen to click events', () => {
+ it('listen to pointerup events', () => {
emulateClick()
expect(actionEventsHooks.onStartEvent).toHaveBeenCalledOnceWith(
{},
- jasmine.objectContaining({ type: 'click' }),
- jasmine.any(Function),
- jasmine.any(Function)
- )
- })
-
- it('listen to non-primary click events', () => {
- // This emulates a Chrome behavior where all click events are non-primary
- emulateClick({ clickEventIsPrimary: false })
- expect(actionEventsHooks.onStartEvent).toHaveBeenCalledOnceWith(
- {},
- jasmine.objectContaining({ type: 'click' }),
+ jasmine.objectContaining({ type: 'pointerup' }),
jasmine.any(Function),
jasmine.any(Function)
)
@@ -85,29 +73,6 @@ describe('listenActionEvents', () => {
expect(actionEventsHooks.onStartEvent).not.toHaveBeenCalled()
})
- describe('dead_click_fixes experimental feature', () => {
- beforeEach(() => {
- stopListenEvents()
-
- updateExperimentalFeatures(['dead_click_fixes'])
- ;({ stop: stopListenEvents } = listenActionEvents(actionEventsHooks))
- })
-
- afterEach(() => {
- resetExperimentalFeatures()
- })
-
- it('listen to pointerup events', () => {
- emulateClick()
- expect(actionEventsHooks.onStartEvent).toHaveBeenCalledOnceWith(
- {},
- jasmine.objectContaining({ type: 'pointerup' }),
- jasmine.any(Function),
- jasmine.any(Function)
- )
- })
- })
-
describe('selection change', () => {
let text: Text
diff --git a/packages/rum-core/src/domain/rumEventsCollection/action/listenActionEvents.ts b/packages/rum-core/src/domain/rumEventsCollection/action/listenActionEvents.ts
index 1966be9e59..9223e24231 100644
--- a/packages/rum-core/src/domain/rumEventsCollection/action/listenActionEvents.ts
+++ b/packages/rum-core/src/domain/rumEventsCollection/action/listenActionEvents.ts
@@ -1,7 +1,7 @@
import type { TimeStamp } from '@datadog/browser-core'
import { addEventListener, DOM_EVENT, isExperimentalFeatureEnabled, timeStampNow } from '@datadog/browser-core'
-export type MouseEventOnElement = MouseEvent & { target: Element }
+export type MouseEventOnElement = PointerEvent & { target: Element }
export interface UserActivity {
selection: boolean
@@ -30,7 +30,7 @@ export function listenActionEvents