Fix: scrolling alt text using a mouse #49

Open
leah wants to merge 1 commit from fix/scroll-alt-text into main

View file

@ -170,6 +170,12 @@ onMounted(() => {
pswp.on('change', () => { pswp.on('change', () => {
textBox.textContent = pswp.currSlide?.data.comment; textBox.textContent = pswp.currSlide?.data.comment;
}); });
// `passive: true` is for Safari compatibility, apparently
const stopEvent = name => textBox.addEventListener(name, event => event.stopPropagation(), { passive: true });
stopEvent('wheel');
stopEvent('pointerdown');
stopEvent('pointercancel');
}, },
}); });
}); });