esthor / react-native-swipeable-list

A zero-dependency Swipeable FlatList for React-Native, with Gestures, Quick Actions, and Animations. Simple as that.
MIT License
588 stars 31 forks source link

shouldBounceOnMount alway true #80

Closed Duya3fithou closed 2 months ago

Duya3fithou commented 3 months ago

shouldBounceOnMount={false} I tried pass false value, but it alway Bounce On first Mount. i use "react-native-swipeable-list": "^0.1.2", "react-native": "0.74.2", Tks for pretty libs and your response

esthor commented 3 months ago

Oh, that's strange. I'll have a look in a bit to see if I can reproduce that. I haven't tested on 0.74.2 of react-native yet.

esthor commented 3 months ago

Hmm, yeah, I just tried this in 0.74 and it's not working as expected. I'll have to take a deeper look and see what's going on.

One area I'm going to look into is that it might be the use of older react native methods under the hood which may not be supported in Hermes. I'm see some hermes related warnings which may be hinting towards that. 🤔

Duya3fithou commented 3 months ago

Hope you can fix soon, tks you on top of that, I think sometime we need disable swip Can you provide that in next release?

Duya3fithou commented 3 months ago

I read your code, and when i pass bounceFirstRowOnMount={false} to SwipeableFlatList, like this: image It's work perfect what i want. May be cause this code: static defaultProps = { ...FlatList.defaultProps, bounceFirstRowOnMount: true, renderQuickActions: () => null, };

esthor commented 2 months ago

Oh yeah, nice find! I bet something is getting messed up in the constructor:

        super(props, context);
        this.state = {
            openRowKey: null,
        };

        this._shouldBounceFirstRowOnMount = this.props.bounceFirstRowOnMount;
    }

or the renderItem logic

        if (this._shouldBounceFirstRowOnMount) {
            this._shouldBounceFirstRowOnMount = false;
            shouldBounceOnMount = true;
        }

Noting to myself (or you, if you wanna take a stab at it). I'll try to find some time this week to fix this.

esthor commented 2 months ago

Your workaround works, so I updated the example app code for now -- https://github.com/esthor/react-native-swipeable-list/pull/84

When I get some more time, I'm going to try and dig into the issue to get to the root of it. 🙏

Duya3fithou commented 2 months ago

Your workaround works, so I updated the example app code for now -- #84

When I get some more time, I'm going to try and dig into the issue to get to the root of it. 🙏

Nice work!