react-native-web-swiper icon indicating copy to clipboard operation
react-native-web-swiper copied to clipboard

Bouces disable?

Open Victorcassiano opened this issue 3 years ago • 7 comments

How to disable this stretched animation?

Victorcassiano avatar Dec 28 '21 22:12 Victorcassiano

Do you have a reproducible example? @Victorcassiano

jarvisluong avatar Jan 25 '22 13:01 jarvisluong

Do you have a reproducible example? @Victorcassiano

the gif shows the screen stretching when dragging, there would be no way to remove that?

Victorcassiano avatar Jan 25 '22 16:01 Victorcassiano

Do you have a reproducible example? @Victorcassiano

the gif shows the screen stretching when dragging, there would be no way to remove that?

sorry, I didn't really get what was the issue

jarvisluong avatar Jan 25 '22 18:01 jarvisluong

@jarvisluong @Victorcassiano wanna to disallow gestures < 0 and > width.

I think it's some additional logic here https://github.com/reactrondev/react-native-web-swiper/blob/6d007d23ccefd33936b0a7fe90d66f58142c2a03/src/Swiper.js#L110-L112

oxyii avatar Jan 25 '22 18:01 oxyii

something like this:

var allow = false;
const changeRequest = vertical ? gestureState.dy : gestureState.dx;
   // if not is last slide -> allow move right                // if not is first slide -> allow move left
if ((activeIndex + 1 < slidesCount  && changeRequest > 0) || (activeIndex > 0 && changeRequest < 0)) {
  allow = Math.abs(changeRequest) > minDistanceToCapture;
}

oxyii avatar Jan 25 '22 19:01 oxyii

I guess what we can do is to expose onMoveShouldSetPanResponderCapture and let user override that logic if needed. How do you think about this approach? @oxyii

jarvisluong avatar Jan 25 '22 19:01 jarvisluong

@jarvisluong I really don't care ))) I don't even work with react anymore. I just explained what @Victorcassiano want.

oxyii avatar Jan 25 '22 19:01 oxyii