You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you try to select the caption with the mouse, touchscreen, etc. it scrolls the screen. To prevent this I made the following change in photoswipe.js:
code revised below
The text was updated successfully, but these errors were encountered:
Actually, to allow text selection via drag in chrome you need to make the changes at the top of the function before preventDefault();
// Pointermove/touchmove/mousemove handler
_onDragMove = function(e) {
// add these 7 lines below before e.preventDefault();
var el = document.elementFromPoint(_currPoint.x, _currPoint.y);
while (el && !el.className) {
el = el.parentElement;
}
if (el.className.indexOf('__caption') > -1) {
return;
}
// add these 7 lines above before e.preventDefault();
e.preventDefault();
One more tweak is needed (to prevent pswp from zooming when drag is released outside of caption). Setting _moved = true; seems to do the trick. Edit: whoops, setting _moved = true; prevented drag inside caption in desktop Chrome. Setting _mainScrollAnimating = true; seems to work better.
if (el.className.indexOf('__caption') > -1) {
_mainScrollAnimating = true; // prevent photoswipe default tap event when drag released outside caption
return; // to allow drag select inside caption don't call e.preventDefault();
}
If you try to select the caption with the mouse, touchscreen, etc. it scrolls the screen. To prevent this I made the following change in photoswipe.js:
code revised below
The text was updated successfully, but these errors were encountered: