yifaneye / react-gallery-carousel

Carousel component 🎠🎠🎠 supporting touch, mouse, keyboard, thumbnails, fullscreen, lazy loading, SSR and customisations. 👉 Live editor: https://yifanai.com/rgcd1
https://yifanai.com/rgc
MIT License
215 stars 30 forks source link

Fix Issue with Iphone #42

Closed a-tonchev closed 3 years ago

a-tonchev commented 3 years ago

Fix Issue with Iphone

yifaneye commented 3 years ago

Thank you @a-tonchev for fixing this issue!

jedlau commented 3 years ago

Thanks for fixing this issue, @a-tonchev , and for merging, @yifaneye !

Quick question: Before calling mediaQueryList.removeEventListener(), I wonder why the check is for mediaQueryList.addEventListener(). In other words, instead of this:

return () => mediaQueryList.addEventListener ? mediaQueryList.removeEventListener('change', callback) : window.removeEventListener('resize', callback);

Maybe it should be this: return () => mediaQueryList.removeEventListener ? mediaQueryList.removeEventListener('change', callback) : window.removeEventListener('resize', callback);

Thoughts? Thanks.

yifaneye commented 3 years ago

Hi @jedlau !

Thank you for pointing it out! 😀

Before I merged dev into master, I had the same thoughts as you. So, I made the change before merging dev into master. The code from v0.2.3 is here

jedlau commented 3 years ago

👍

a-tonchev commented 3 years ago

@jedlau is right, I must have copy paste mistake :)