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

Clarification on onValueChange Behavior Across Platforms #562

Closed
landabaso opened this issue Dec 16, 2023 · 2 comments · Fixed by #563
Closed

Clarification on onValueChange Behavior Across Platforms #562

landabaso opened this issue Dec 16, 2023 · 2 comments · Fixed by #563
Labels
bug report Something isn't working platform: Web Issue relates to react-native for web question Further information is requested

Comments

@landabaso
Copy link
Contributor

Hello, and thank you for developing the react-native-slider package. I've been using it in my project and am extremely grateful for its existence.

I've noticed a discrepancy in behavior between the web and native platforms (Android & iOS) regarding the onValueChange event. Specifically, I'm uncertain if onValueChange should be triggered by programmatic changes to the slider value, as I couldn't find specific documentation on this aspect.

On web,onValueChange is called when doing programmatic changes of value but not on iOS/Android.

Could you clarify if it's reliable to assume that programmatic changes to the slider value will not trigger the onValueChange event? My concern stems from the need to distinguish between user-initiated and programmatic changes.

Upon reviewing the code, I observed that the Android implementation utilizes a fromUser flag to differentiate the source of changes, but I didn't find a similar mechanism in the web implementation. Here is the relevant section of the code I was looking at:

While I have examined the code, I must admit that I'm not completely familiar with the entire codebase, so I may have missed something pertinent.

Any guidance or clarification you can provide on this behavior would be greatly appreciated.

Thank you for your time and effort in maintaining this package.

@landabaso
Copy link
Contributor Author

After further consideration, I believe this inconsistency actually constitutes a bug. I've submitted a Pull Request for your review: PR #563.

@BartoszKlonowski BartoszKlonowski added bug report Something isn't working platform: Web Issue relates to react-native for web labels Dec 17, 2023
@BartoszKlonowski
Copy link
Member

Yes, this looks like a bug, thank you for taking so much time to investigate! 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something isn't working platform: Web Issue relates to react-native for web question Further information is requested
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants