phucbm / flickity-responsive

💻📱Responsive option for Flickity.
https://flickity.netlify.app
MIT License
7 stars 0 forks source link

Wrong index to make custom arrow be disabled #8

Closed vuquangpham closed 1 year ago

vuquangpham commented 1 year ago

Fix a bug: Wrong index

With old code, we check the current index of the slide based on input (just a number, similar to the index of change event).

But that's the wrong index (what happens when we change the groupCells of flkty to another, different to 1) and selectedIndex is just a number, but is-selected in DOM is more than 1. So I think that the selectedIndex that we used is just a current index of flickity dots (fix me if I'm wrong because I haven't read the flkty source code before).

So I have made a little change to make it work based on the is-selected position. Please check it! Many thanks.

netlify[bot] commented 1 year ago

Deploy Preview for flickity ready!

Name Link
Latest commit 71b003216c9e65f25aadc0135332704c58be34ae
Latest deploy log https://app.netlify.com/sites/flickity/deploys/6377023c14a159000a1033d6
Deploy Preview https://deploy-preview-8--flickity.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.