From 71ffcb5aab72f5023760896d7a68d182e6a6c73b Mon Sep 17 00:00:00 2001 From: Vladimir Kharlampidi Date: Tue, 3 Aug 2021 17:28:09 +0300 Subject: [PATCH] feat(core): `touchEventsTarget` is now default to `wrapper` fixes #4751 ref #3816 --- cypress/support/commands.js | 4 ++-- src/core/defaults.js | 2 +- src/types/swiper-options.d.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 618b23e75..55b1c2799 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -149,14 +149,14 @@ Cypress.Commands.add('injectStyles', { prevSubject: 'optional' }, (subject, cssS }); Cypress.Commands.add('swipeLeft', () => { - cy.getSliderContainer() + cy.getSliderWrapper() .trigger('pointerdown', { which: 1, pageX: 100, pageY: 100, force: true }) .trigger('pointermove', { pageX: 50, pageY: 100, force: true }) .trigger('pointerup', { force: true }); }); Cypress.Commands.add('swipeRight', () => { - cy.getSliderContainer() + cy.getSliderWrapper() .trigger('pointerdown', { which: 1, pageX: -100, pageY: 100, force: true }) .trigger('pointermove', { pageX: 50, pageY: 100, force: true }) .trigger('pointerup', { force: true }); diff --git a/src/core/defaults.js b/src/core/defaults.js index 649cce9aa..19be788c1 100644 --- a/src/core/defaults.js +++ b/src/core/defaults.js @@ -1,7 +1,7 @@ export default { init: true, direction: 'horizontal', - touchEventsTarget: 'container', + touchEventsTarget: 'wrapper', initialSlide: 0, speed: 300, cssMode: false, diff --git a/src/types/swiper-options.d.ts b/src/types/swiper-options.d.ts index 1fcad96c6..5fb0a4f9b 100644 --- a/src/types/swiper-options.d.ts +++ b/src/types/swiper-options.d.ts @@ -346,7 +346,7 @@ export interface SwiperOptions { * Target element to listen touch events on. Can be `'container'` (to listen for touch events on swiper-container) or `'wrapper'` * (to listen for touch events on swiper-wrapper) * - * @default 'container' + * @default 'wrapper' */ touchEventsTarget?: 'container' | 'wrapper';