Closed efstathiosntonas closed 1 year ago
disableTrackFollow
prop is the culprit. Trying to figure what is causing it.
hey, @efstathiosntonas, its a bit repetitive during the swipe, so I remove thumb logic. this is before video, maybe need to do adjust for this.
After going through the entire diff between 2.0.8 and 2.1.1 I realised that you're using ref only on the bubble so discard the intro on the initial comment. Something is causing the thumb to not move if disableTrackFollow
is enabled. Looking into it now.
just check it, make sense!
maybe we just make the disableTrackFollow
change to Animated.SharedValue
, and turn it when isScrubbing=true
.
we don't need it when isScrubbing = false.
also, add you to manage of this lib, feel free to change it.
just fixed thumbIndex.value === 0;
to thumbIndex.value = 0;
, and released to v2.1.2
, thanks found it.
also disableTrackFollow
still needs to check.
Thanks for adding me as a collaborator. This useAnimatedReaction is causing the issue, at 2.0.8 the calculations where different.
This entire function is missing from 2.1.1
// setting thumbValue
useAnimatedReaction(
() => {
if (isScrubbing && isScrubbing.value) {
return undefined;
}
if (step) {
return undefined;
}
const currentValue =
(progress.value / (minimumValue.value + maximumValue.value)) *
(width.value - (disableTrackFollow ? thumbWidth : 0));
return clamp(currentValue, 0, width.value - thumbWidth);
},
data => {
if (data !== undefined) {
thumbValue.value = data;
}
},
[thumbWidth, maximumValue, minimumValue, step, progress, width],
);
when i added it back it worked as it should 🤔
yeah, I didn't know you needed this before.
now I know you add isScrubbing
prop to work this, but I'm not sure other people will add isScrubbing
prop, I hope this component is simple to use.
so I think need an isScrubbingInner
value to use the inner component, that's prefect!
It won't work if I remove the isScrubbing
prop and enable the disableTrackFollow
prop. Am I missing something on the "config"?
Just to be sure we're on the same page, this is how I'm using it:
https://user-images.githubusercontent.com/717975/191932005-3efe69a3-5ae5-452a-aed2-a75727d4a949.mov
https://github.com/alantoa/react-native-awesome-slider/pull/27/files
just created a PR, I think should fix both issues.
and released v2.1.3
.
Just tested it, it works as it should. Thanks @alantoa, good work!
Hi @alantoa, after upgrading from 2.0.8 to 2.1.1 the thumb stopped moving while playing audio files, downgrading to 2.0.8 works as expected. I've seen you've made some perfomance improvements using refs, I believe the ref value isn't updating the UI (at least in my case where progress is an event and not static thumb movement).
This is how I use it:
progress
prop isconst progress = useSharedValue(0);
and it's been incremented by the audio player progress event.Let me know if you need any additional info, I will go through the changes you've introduced and let you know if I figure out what is going on.