File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
package/src/components/ProgressControl Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ export const WaveProgressBar = React.memo(
100100 ) ;
101101 const eachWaveformWidth = WAVEFORM_WIDTH + WAVEFORM_GAP ;
102102 const fullWidth = ( amplitudesCount - 1 ) * eachWaveformWidth ;
103+ const maxThumbTranslateX = Math . max ( fullWidth - eachWaveformWidth , 0 ) ;
103104 const maxProgressWidth = fullWidth + WAVEFORM_WIDTH ;
104105 const dragStartProgress = useSharedValue ( 0 ) ;
105106 const isDragging = useSharedValue ( false ) ;
@@ -217,9 +218,16 @@ export const WaveProgressBar = React.memo(
217218 const thumbStyles = useAnimatedStyle (
218219 ( ) => ( {
219220 position : 'absolute' ,
220- transform : [ { translateX : clampProgress ( visualProgress . value ) * fullWidth } ] ,
221+ transform : [
222+ {
223+ translateX : Math . min (
224+ clampProgress ( visualProgress . value ) * fullWidth ,
225+ maxThumbTranslateX ,
226+ ) ,
227+ } ,
228+ ] ,
221229 } ) ,
222- [ fullWidth ] ,
230+ [ fullWidth , maxThumbTranslateX ] ,
223231 ) ;
224232
225233 return (
You can’t perform that action at this time.
0 commit comments