We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://znrm.cz/swiper.html
Zoom works fine when swiper is on position 0,0 at document. But when window.scrollY= 10000px zoom not works fine. BUG is in ducntion getScaleOrigin()
FIX is here: function getScaleOrigin() { if (evCache.length < 2) return { x: null, y: null }; const box = gesture.imageEl.getBoundingClientRect(); const scrollY = window.scrollY; // FIX const scrollX = window.scrollX; // FIX return [(evCache[0].pageX + (evCache[1].pageX - evCache[0].pageX) / 2 - box.x - scrollX) / currentScale, (evCache[0].pageY + (evCache[1].pageY - evCache[0].pageY) / 2 - box.y - scrollY) / currentScale]; // FIX }
No response
10
Mobile
The text was updated successfully, but these errors were encountered:
2cf3fc2
Successfully merging a pull request may close this issue.
Check that this is really a bug
Reproduction link
https://znrm.cz/swiper.html
Bug description
Zoom works fine when swiper is on position 0,0 at document. But when window.scrollY= 10000px zoom not works fine.
BUG is in ducntion getScaleOrigin()
FIX is here:
function getScaleOrigin() {
if (evCache.length < 2) return {
x: null,
y: null
};
const box = gesture.imageEl.getBoundingClientRect();
const scrollY = window.scrollY; // FIX
const scrollX = window.scrollX; // FIX
return [(evCache[0].pageX + (evCache[1].pageX - evCache[0].pageX) / 2 - box.x - scrollX) / currentScale, (evCache[0].pageY + (evCache[1].pageY - evCache[0].pageY) / 2 - box.y - scrollY) / currentScale]; // FIX
}
Expected Behavior
No response
Actual Behavior
No response
Swiper version
10
Platform/Target and Browser Versions
Mobile
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: