rn-range-slider icon indicating copy to clipboard operation
rn-range-slider copied to clipboard

Slider inside ScrollView is not smooth in both iOS and Android

Open shivamtiwari8736 opened this issue 6 years ago • 14 comments
trafficstars

Sliding in iOS and Android is not smooth. It leaves thumb while scrolling. I have taken Range Slider inside ScrollView. On top there is Range Slider and after that a list from API. When there is less items that no scroll needed, Range Slider works with absolute beauty. But when there is enough data in list that makes scroll view to scroll, the problem Occurs on both android and iOS.

shivamtiwari8736 avatar Jul 29 '19 04:07 shivamtiwari8736

@shivamtiwari8736 , thanks for reporting. I will have a look on this weekend.

githuboftigran avatar Jul 31 '19 14:07 githuboftigran

Hi @githuboftigran , Any update buddy?

shivamtiwari8736 avatar Aug 05 '19 05:08 shivamtiwari8736

@shivamtiwari8736 , sorry dude, couldn't find some time on this weekend... I will add a comment here when I find the problem

githuboftigran avatar Aug 05 '19 05:08 githuboftigran

@githuboftigran, Any update on this issue?

shikhawebvillee avatar Oct 24 '19 07:10 shikhawebvillee

@shikhawebvillee , nope... I asked some developers, they couldn't help

githuboftigran avatar Oct 24 '19 07:10 githuboftigran

Facing the same issue. Anyone found the solution for this ?

ChandanCBL avatar Apr 22 '20 06:04 ChandanCBL

For those having the same issue you can use the onTouchStart and the onTouchEnd functions to enable and disable the scrollview this is my implementation this.state = { allowScroll:true, }

    <ScrollView scrollEnabled={this.state.allowScroll}>

      <RangeSlider
      min={10}
      max={1000}
      step={10}
      onTouchStart={()=>{this.setState({allowScroll:false})}}
      onTouchEnd={()=>{this.setState({allowScroll:true})}}/>
    </ScrollView>

DanielMalak avatar Jun 09 '20 13:06 DanielMalak

@shivamtiwari8736 , @DanielMalak @ChandanCBL @shikhawebvillee , just published v2. Now PanResponder is used for touches. Is this issue still in there?

githuboftigran avatar Oct 30 '20 19:10 githuboftigran

There is one more thing that I recommend. If you are using some state management library like redux, do not update store from onValueChanged function. It slows down the system a lot. Instead, it's performance-wise to launch update function from onTouchEnd function.

haruhiroYakumo avatar Jan 22 '21 09:01 haruhiroYakumo

@githuboftigran same issue with v2.

Great-hijack avatar Mar 05 '21 16:03 Great-hijack

I have similar problem, but in modal using React Navigation on iOS. I was not able to find any way to temporarily disable the swipe to dismiss.

KingDoxik avatar Oct 02 '21 13:10 KingDoxik

@KingDoxik I'm facing the same issue, did you find any solution?

Nehal-Sanklecha avatar Oct 28 '21 09:10 Nehal-Sanklecha

@Nehal-Sanklecha I switched to full screen modal. It is not the best solution, but the only one I came up with to temporarily fix this issue.

KingDoxik avatar Oct 28 '21 11:10 KingDoxik

it was not smooth in scrollView for me ,while moving slider scroll starts to move! (especially iOS) I solved it by scrollview property "disableScrollViewPanResponder={true}"

mrshahzeb7 avatar Nov 24 '21 08:11 mrshahzeb7

Hey all, just published a new version: 2.2.1. Now slider captures touches when movement is more horizontal, than vertical (ratio is 2, so it will capture touches, if dx > 2 * dy)

githuboftigran avatar Sep 13 '22 08:09 githuboftigran