fix: Touch gestures should count as card interactions (#2265)
- Closes: #2245
This commit is contained in:
@@ -96,6 +96,14 @@ export class CardElementManager {
|
|||||||
'wheel',
|
'wheel',
|
||||||
this._api.getInteractionManager().reportInteraction,
|
this._api.getInteractionManager().reportInteraction,
|
||||||
);
|
);
|
||||||
|
this._element.addEventListener(
|
||||||
|
'touchstart',
|
||||||
|
this._api.getInteractionManager().reportInteraction,
|
||||||
|
);
|
||||||
|
this._element.addEventListener(
|
||||||
|
'touchmove',
|
||||||
|
this._api.getInteractionManager().reportInteraction,
|
||||||
|
);
|
||||||
this._element.addEventListener(
|
this._element.addEventListener(
|
||||||
'll-custom',
|
'll-custom',
|
||||||
this._api.getActionsManager().handleCustomActionEvent,
|
this._api.getActionsManager().handleCustomActionEvent,
|
||||||
@@ -166,6 +174,14 @@ export class CardElementManager {
|
|||||||
'wheel',
|
'wheel',
|
||||||
this._api.getInteractionManager().reportInteraction,
|
this._api.getInteractionManager().reportInteraction,
|
||||||
);
|
);
|
||||||
|
this._element.removeEventListener(
|
||||||
|
'touchstart',
|
||||||
|
this._api.getInteractionManager().reportInteraction,
|
||||||
|
);
|
||||||
|
this._element.removeEventListener(
|
||||||
|
'touchmove',
|
||||||
|
this._api.getInteractionManager().reportInteraction,
|
||||||
|
);
|
||||||
this._element.removeEventListener(
|
this._element.removeEventListener(
|
||||||
'll-custom',
|
'll-custom',
|
||||||
this._api.getActionsManager().handleCustomActionEvent,
|
this._api.getActionsManager().handleCustomActionEvent,
|
||||||
|
|||||||
@@ -119,6 +119,14 @@ describe('CardElementManager', () => {
|
|||||||
'action',
|
'action',
|
||||||
api.getInteractionManager().reportInteraction,
|
api.getInteractionManager().reportInteraction,
|
||||||
);
|
);
|
||||||
|
expect(addEventListener).toBeCalledWith(
|
||||||
|
'touchstart',
|
||||||
|
api.getInteractionManager().reportInteraction,
|
||||||
|
);
|
||||||
|
expect(addEventListener).toBeCalledWith(
|
||||||
|
'touchmove',
|
||||||
|
api.getInteractionManager().reportInteraction,
|
||||||
|
);
|
||||||
expect(windowAddEventListener).toBeCalledWith('location-changed', expect.anything());
|
expect(windowAddEventListener).toBeCalledWith('location-changed', expect.anything());
|
||||||
expect(windowAddEventListener).toBeCalledWith('popstate', expect.anything());
|
expect(windowAddEventListener).toBeCalledWith('popstate', expect.anything());
|
||||||
|
|
||||||
@@ -171,6 +179,14 @@ describe('CardElementManager', () => {
|
|||||||
'action',
|
'action',
|
||||||
api.getInteractionManager().reportInteraction,
|
api.getInteractionManager().reportInteraction,
|
||||||
);
|
);
|
||||||
|
expect(removeEventListener).toBeCalledWith(
|
||||||
|
'touchstart',
|
||||||
|
api.getInteractionManager().reportInteraction,
|
||||||
|
);
|
||||||
|
expect(removeEventListener).toBeCalledWith(
|
||||||
|
'touchmove',
|
||||||
|
api.getInteractionManager().reportInteraction,
|
||||||
|
);
|
||||||
expect(windowRemoveEventListener).toBeCalledWith(
|
expect(windowRemoveEventListener).toBeCalledWith(
|
||||||
'location-changed',
|
'location-changed',
|
||||||
expect.anything(),
|
expect.anything(),
|
||||||
|
|||||||
Reference in New Issue
Block a user