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

Unable to select more than 10 sections #12

Closed
simonnoff opened this issue Apr 25, 2018 · 4 comments
Closed

Unable to select more than 10 sections #12

simonnoff opened this issue Apr 25, 2018 · 4 comments

Comments

@simonnoff
Copy link
Contributor

When I try to have more than 10 sections (for example 20) and try to select 16 (selectedSection: 16, sections: 20) on slider initialization, I was not able to see the 16 selected sections. After looking at the code, I realized that because on initialization, the selectedSection variable is updated before the sections variable, my change on sections value does not take place and thus selectedSection is capped to 10.

Solution: if you swap the place of initializing sections and selectedSection, everything should work. For reference, swap line 490 with line 491. The problem comes from didSet on line 440.

I don't mind forking the repo and using my own version of the slider, but I really want to benefit from future updates since this is one great project which is made amazingly well. Congratulations :) I would be thankful if you made this simple fix.

@LeonardoCardoso
Copy link
Owner

Hi, @simonnoff. Can you create a PR with the fix?

@simonnoff
Copy link
Contributor Author

simonnoff commented Apr 26, 2018

@LeonardoCardoso Yes, I will do so.

@simonnoff
Copy link
Contributor Author

Just did it, waiting for approval!

@LeonardoCardoso
Copy link
Owner

LeonardoCardoso commented Apr 27, 2018

@simonnoff done. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants