Skip to content

Commit

Permalink
feat(core): touchEventsTarget is now default to wrapper
Browse files Browse the repository at this point in the history
fixes #4751
ref #3816
  • Loading branch information
nolimits4web committed Aug 3, 2021
1 parent 9210f84 commit 71ffcb5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
2 changes: 1 addition & 1 deletion src/core/defaults.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
init: true,
direction: 'horizontal',
touchEventsTarget: 'container',
touchEventsTarget: 'wrapper',
initialSlide: 0,
speed: 300,
cssMode: false,
Expand Down
2 changes: 1 addition & 1 deletion src/types/swiper-options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down

0 comments on commit 71ffcb5

Please sign in to comment.