Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make customArrows option be accessed through all events #22

Closed
wants to merge 3 commits into from

Conversation

vuquangpham
Copy link
Contributor

@vuquangpham vuquangpham commented Mar 24, 2023

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).

@vuquangpham vuquangpham added the bug Something isn't working label Mar 24, 2023
@vuquangpham vuquangpham requested a review from phucbm March 24, 2023 03:59
@vuquangpham vuquangpham self-assigned this Mar 24, 2023
@phucbm phucbm linked an issue Apr 5, 2023 that may be closed by this pull request
@vuquangpham vuquangpham changed the title Bug with object allocation in memory CustomArrows options can't be accessed through all the events Apr 6, 2023
@vuquangpham vuquangpham changed the title CustomArrows options can't be accessed through all the events CustomArrows option can't be accessed through all the events Apr 6, 2023
@vuquangpham vuquangpham changed the title CustomArrows option can't be accessed through all the events Make customArrows option be accessed through all events Apr 6, 2023
@vuquangpham vuquangpham closed this Apr 6, 2023
@vuquangpham vuquangpham deleted the bug-with-custom-navigation branch April 6, 2023 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom arrows not hidden when the carousel is not enabled
1 participant