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.
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).
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
throughoptions.customArrows
, but this option is created inonMatched
event and we invoke this function insideonLoad
andonResize
events. So that we don't have anything change.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 inonLoad
andonResize
events.Solution
customArrows
to be part of theFlickity instance
, so that it will be accessed through all the events (onLoad
,onMatched
,onResize
).