Fork of Chiri for Astro for my blog
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: mobile img viewer scroll issue

the3ash f4f8e823 0bba6d97

+12
+12
src/components/ui/ImageViewer.astro
··· 18 18 viewer?.classList.add('active') 19 19 document.body.classList.add('image-viewer-open') 20 20 document.body.style.overflow = 'hidden' 21 + document.body.dataset.scrollY = window.scrollY.toString() 21 22 if (viewer) { 22 23 viewer.style.cursor = 'auto' 23 24 setTimeout(() => { ··· 58 59 } 59 60 60 61 viewer?.addEventListener('click', hideImage) 62 + 63 + // Prevent touch scroll in image viewer 64 + viewer?.addEventListener( 65 + 'touchmove', 66 + (e) => { 67 + if (viewer.classList.contains('active')) { 68 + e.preventDefault() 69 + } 70 + }, 71 + { passive: false } 72 + ) 61 73 62 74 document.addEventListener('keydown', (e) => { 63 75 if (e.key === 'Escape' && viewer.classList.contains('active')) {