deanhet / react-native-text-ticker

React Native Text Ticker/Marquee Component
MIT License
444 stars 75 forks source link

onMarqueeComplete is not called when animationType is 'bounce' #58

Closed high1 closed 4 years ago

high1 commented 4 years ago

I tried to make animations change dynamically, didn't succeed, but saw this.

deanhet commented 4 years ago

I see what you're describing but this is currently intentional behaviour (mainly because nobody has ever needed both up to now). If the animation is bouncing, the marquee is never really finished as it runs forever, so onMarqueeComplete will never run.

If you're looking for different behaviour, I'd be happy to review a PR with any additional features.

high1 commented 4 years ago

Hm, I see what you mean - but same could be argued for scrolling, could it not? I did take a look at the code, and I see that animating is set to false only when the component is unmounted, so there is actually no end in the cycle? Maybe I'm misunderstanding the way the component should behave.

deanhet commented 4 years ago

That's a really good point. Would you mind posting an example of your code and what you want it to do? I'll take another look at it.

high1 commented 4 years ago

I'll try to find some time to create a few pull requests, so you could see what I mean - and then you can judge if it fits the way the component is meant to be used.