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

fix: check for invalid configuration in limit settings #638

Merged
merged 6 commits into from
Sep 24, 2024

Conversation

draggie
Copy link
Contributor

@draggie draggie commented Sep 10, 2024

Summary:

fixes: #571
Apply additional check and move the progress calculation to Slider class

Test Plan:

Have ran the application examples on new/old arch witch success - the crash is not happening anymore.

@draggie draggie self-assigned this Sep 10, 2024
Copy link
Member

@BartoszKlonowski BartoszKlonowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If lowerLimit > upperLimit we shouldn't fallback to upperLimit. If we do that, then we will end up with having lowerLimit === upperLimit, which will prevent Slider from moving at all. This is not the best experience.
If a dev/user makes a simple mistake, typo, of having lowerLimit greater than the upper one, then we should just avoid setting that incorrect limit. In that worst case, the limit that is incorrect will just not work, not the whole Slider.

package/ios/RNCSliderManager.m Outdated Show resolved Hide resolved
package/ios/RNCSliderManager.m Outdated Show resolved Hide resolved
package/src/Slider.tsx Outdated Show resolved Hide resolved
Copy link
Member

@BartoszKlonowski BartoszKlonowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good! 👍

package/src/Slider.tsx Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants