fix(Slider): center thumb on pressed location of the track #3821
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
allowTouchTrackis set totrue, I expect the center of the thumb to be positioned over my tapped location. Currently, it aligns to the left of the thumb instead of the center.allowTouchTrackisfalse, I can tap anywhere inside the thumb and the thumb position does not change until I begin dragging. But ifallowTouchTrackistrue, the thumb will immediately left-align itself when I tap anywhere inside the thumb. I expect this behavior of tapping and dragging the thumb to be consistent no matter what the value ofallowTouchTrackis.You can see both issues in the video below. You can reproduce the issue in the Slider examples in the example app.
rneui_slider_before.mov
rneui_slider_after.mov
Type of change
How Has This Been Tested?
I've manually tested the changed behavior using the example app on an iOS iPhone 14 simulator.
exampleappChecklist
yarn docs-build-apiAdditional context
N/A