Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

touchStartPreventDefault: false breaks standard behavior #7344

Open
5 of 6 tasks
scottgonzalez opened this issue Feb 28, 2024 · 1 comment
Open
5 of 6 tasks

touchStartPreventDefault: false breaks standard behavior #7344

scottgonzalez opened this issue Feb 28, 2024 · 1 comment

Comments

@scottgonzalez
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://jsbin.com/mobisanici/edit?html,css,js,output

Bug description

When using touchStartPreventDefault: false and swiping on an image, the interaction either doesn't work or stops working randomly.

Moving the image down with z-index: -1 fixes the issue.

Expected Behavior

Swiping on an image works.

Actual Behavior

Native drag often occurs.

Swiper version

11.0.6

Platform/Target and Browser Versions

macOS Brave 1.6.153 (Chromium 121.0.6167.85)

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@9romise
Copy link
Contributor

9romise commented Mar 31, 2024

This segment of CSS might solve your problem.

.swiper-slide {
  user-select: none;
}
.swiper-slide img {
  pointer-events: none;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants