Skip to content

value change does not change StepMarker position #715

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

wjaszczuk
Copy link

Summary:

This PR fixes #712

I've noticed that StepMarker internally uses the currentValue property. This property is set in the onValueChangeEvent event handler, but when the user changes the value, the change is not reflected by currentValue.

I added a useEffect hook, which listens to changes of value and sets ```currentValue ``.

I added a test for that. I ran it before and after the changes were made. It failed without my fix.

I also added @testing-library/react-native, and I refactored all existing tests to use render and screen from the mentioned library. The reason for that was a deprecation warning from the react-test-renderer create function (https://react.dev/warnings/react-test-renderer).

The snapshots remained the same.

Test Plan:

I added unit tests for the bug. The test failed without my fix.
I tested it manually, using the example application too.

I also provided recordings from tests:

before changes

before_changes.mov

after changes

after_changes.mov

Wiktor Jaszczuk added 3 commits June 10, 2025 14:28
Slider listens to changes on value and set current value, and the StepMarker will be set correctly (if it is set)
@wjaszczuk wjaszczuk self-assigned this Jun 11, 2025
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

Successfully merging this pull request may close these issues.

Unable to move the thumb position from outside the slider when having a custom thumbImage
1 participant