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

Fix: Ensure the Zoom module's array is cleared onTouchEnd #7830

Merged

Conversation

broox
Copy link
Contributor

@broox broox commented Dec 22, 2024

This fixes an issue in which long pressing a slide's image left the zoom module in a bad state.

Closes #7304

@@ -28,7 +28,6 @@ export default function Zoom({ swiper, extendParams, on, emit }) {
let isScaling = false;
let fakeGestureTouched;
let fakeGestureMoved;
let preventZoomOut;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 this was simply unused.

@@ -378,6 +377,7 @@ export default function Zoom({ swiper, extendParams, on, emit }) {
}
function onTouchEnd() {
const zoom = swiper.zoom;
evCache.length = 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Chrome for iOS, long pressing a slide's image would leave the previous touch event in the evCache array.
This ensure that evCache is cleared onTouchEnd.

@broox broox changed the title Ensure the zoom module's array is cleared onTouchEnd to Ensure the zoom module's array is cleared onTouchEnd to fix a bug when long pressing a slide Dec 22, 2024
@broox broox changed the title Ensure the zoom module's array is cleared onTouchEnd to fix a bug when long pressing a slide Fix: Ensure the Zoom module's array is cleared onTouchEnd Dec 22, 2024
@nolimits4web nolimits4web merged commit 21610bd into nolimits4web:master Jan 2, 2025
3 checks passed
@nolimits4web
Copy link
Owner

Merged, thank you!

@broox broox deleted the mobile-chrome-long-press-bugfix branch January 2, 2025 18:15
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

Successfully merging this pull request may close these issues.

Long pressing on a zoomable slide breaks zoom interactions for that slide
2 participants