n4kz / react-native-pages

Easy to use page view component
Other
376 stars 83 forks source link

Indicator working randomly (Android) #19

Closed hardcodet closed 6 years ago

hardcodet commented 6 years ago

Hi there

Lastest NPM package, RN 0.51 (Expo 24) Galaxy S6, Android 7.0

First of all thanks for a very neat component! I just did a trial run and noticed some rather random behavior with the indicator - the counter sometimes moves, sometimes doesn't (more often, it doesn't update), while the actual swiping between the views isn't a problem. Here's my code:

render() {
    return (
        <View style={{flex: 1, backgroundColor: "black"}}>
            <Pages style={{flex: 1}}>
                <View style={{ flex: 1 }}>
                    <Text style={{color: "white"}}>Page 0</Text>
                </View>

                <View style={{ flex: 1 }}>
                    <Text style={{color: "white"}}>Page 1</Text>
                </View>

                <View style={{ flex: 1 }}>
                    <Text style={{color: "white"}}>Page 2xy</Text>
                </View>
            </Pages>
        </View>
    );
}

Here's the indicator after some scrolling back and forth. Showing the 3rd page with the indicator selecting the 2nd:

I only saw the (closed) issue about Android not rendering at all, but the random updates seem to be different.

hardcodet commented 6 years ago

Edit: I still started applying the control (making the component more complex etc), and during that process, the issue magically went away. The code I pasted really was everything I had in that render method, no idea what caused it.

I'll leave this open in case you want to investigate, but feel free to close anytime. Thanks for this, I really like it so far šŸ‘ šŸ‘ šŸ‘

n4kz commented 6 years ago

Thanks for issue, it looks definitely strange. Probably it's related to animation bugs or missing scroll events. Glad that it's working now as expected. Please let me know if you accidentally find a way to reproduce this bug.