phucbm / flickity-responsive

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

Make customArrows option be accessed through all events #25

Closed vuquangpham closed 1 year ago

vuquangpham commented 1 year ago

Problem

Flickity Responsive doesn't hide custom arrows when the slider is not slideable while we already had this function.

Why

In the responsive-navigation function, we only hide the customArrows through options.customArrows, but this option is created in onMatched event and we invoke this function inside onLoad and onResize events. So that we don't have anything change.

image

And a small notice that the object between each event is different in memory. So that the customArrows option that we created in onMatched doesn't exist in onLoad and onResize events.

Solution

Make the option customArrows to be part of the Flickity instance, so that it will be accessed through all the events (onLoad, onMatched, onResize).

netlify[bot] commented 1 year ago

Deploy Preview for flickity ready!

Name Link
Latest commit ba317f0f6acb0af6485adf4a3ddc8ccfd2de8dba
Latest deploy log https://app.netlify.com/sites/flickity/deploys/642e7b1d6bd0630008a84fcb
Deploy Preview https://deploy-preview-25--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.