Fix scrolling alt text using a mouse

Co-authored-by: BlankEclair <blankeclair@disroot.org>
This commit is contained in:
CenTdemeern1 2024-12-10 15:12:56 +01:00 committed by fly_mc
parent 2c4fc485e4
commit 8496e0af97

View file

@ -173,6 +173,12 @@ onMounted(() => {
pswp.on('change', () => {
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');
},
});
});