Skip to content

Clarification on onValueChange Behavior Across Platforms #562

@landabaso

Description

@landabaso

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug reportSomething isn't workingplatform: WebIssue relates to react-native for webquestionFurther information is requested

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions