react-native-image-slider-box icon indicating copy to clipboard operation
react-native-image-slider-box copied to clipboard

circleLoop not working properly

Open YankovWeb opened this issue 2 years ago • 3 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

circleLoop not working properly is scrolling to the first image and is not looking as infinity loop.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-image-slider-box/dist/SliderBox.js b/node_modules/react-native-image-slider-box/dist/SliderBox.js
index 476963c..a2f4b32 100644
--- a/node_modules/react-native-image-slider-box/dist/SliderBox.js
+++ b/node_modules/react-native-image-slider-box/dist/SliderBox.js
@@ -58,7 +58,7 @@ export class SliderBox extends Component {
   }
 
   onSnap(index) {
-    this._ref.snapToItem(index);
+    //this._ref.snapToItem(index);
     const { currentImageEmitter } = this.props;
     this.setState({ currentImage: index }, () => {
       if (currentImageEmitter) {

This issue body was partially generated by patch-package.

YankovWeb avatar Oct 05 '23 14:10 YankovWeb

how can I use this patch?

Tina-Mai avatar Mar 22 '24 23:03 Tina-Mai

how can I use this patch?

Go to this file in your project

node_modules/react-native-image-slider-box/dist/SliderBox.js

And find the red line and change it with the green line. then use patch:

https://www.npmjs.com/package/patch-package

To be able to share the changes in git repo.

YankovWeb avatar Mar 22 '24 23:03 YankovWeb

thanks for the quick response!

Tina-Mai avatar Mar 22 '24 23:03 Tina-Mai