GithubHelp home page GithubHelp logo

Comments (11)

braco avatar braco commented on June 11, 2024 4

Check out the example

https://github.com/dancormier/react-native-swipeout/blob/master/example/index.ios.js

from react-native-swipeout.

DaveAdams88 avatar DaveAdams88 commented on June 11, 2024

+1 I'm looking to close the open swipeout item when scrolling the Scrollview

from react-native-swipeout.

iicdii avatar iicdii commented on June 11, 2024

I think it will work with onOpen, _close method in Swipeout and componentWillReceiveProps lifecycle in ListView item component.

from react-native-swipeout.

hufeng avatar hufeng commented on June 11, 2024

+1, now i am directly use a ref to call _close

from react-native-swipeout.

chirag04 avatar chirag04 commented on June 11, 2024

+1. using _close for now.

from react-native-swipeout.

Yuzeyang avatar Yuzeyang commented on June 11, 2024

@hufeng i am directly call _close too, but it can not work, can you show your code?

from react-native-swipeout.

xuanpyco avatar xuanpyco commented on June 11, 2024

+1. I'm using _close too.

from react-native-swipeout.

olejka91 avatar olejka91 commented on June 11, 2024

@xuanpyco Hi, can you provide me with your solution? Becuase I use ref, call _close and it does not work. Thanks in advance

from react-native-swipeout.

xuanpyco avatar xuanpyco commented on June 11, 2024

@olejka91 I ended up a solution as following.

class ListItem extends Component {

_onSwipeOpen = () => {
this.props.onSwipeOpen(this.swipeInstance);
}

render() {
return (
<SwipeOut
ref={instance => this.swipeInstance = instance}
onOpen={this._onSwipeOpen}
/>
);
}

}

class MyList extends Component {

_onSwipeOpen = (swipeInstance) => {
if(this.currentlyOpenSwipe && this.currentlyOpenSwipe !== swipeInstance) {
this.currentlyOpenSwipe._close();
}

this.currentlyOpenSwipe = swipeInstance;
}

_renderRow  = () => {
 return (
<ListItem
 onSwipeOpen={this._onSwipeOpen}
/>
);
}

render(){
return (
<ListView
renderRow={this._renderRow}
 />
}
}

from react-native-swipeout.

olejka91 avatar olejka91 commented on June 11, 2024

@xuanpyco I just replaced this library with a react-native-swipe-list-view. Thanks for reply

from react-native-swipeout.

kalraneeraj24550 avatar kalraneeraj24550 commented on June 11, 2024

thanks @xuanpyco sir, your solution worked for me.

from react-native-swipeout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.