I faced the problem when the text fits in container width. In that case I want the text just align on center by {textAlign: 'center'}. However this.setState({ animating: true }); is called even before this.calculateMetrics(); thus the static text with center aligned opacity is set to 0 and show ScrollView instead.
This PR aims to solve this by calling this.setState({ animating: true }); after contentFits is known. And if contentFits is true, instead of animating it, just leave it as is and call
this.stop();
onMarqueeComplete();
after duration passed.
Disclaimer
I don't actually test this because setting up environment is somehow not convenient and the paths in the index.js are entangled. So please test before accept or reject. If there is more time I will create PR for testing locally.
I faced the problem when the text fits in container width. In that case I want the text just align on center by
{textAlign: 'center'}
. Howeverthis.setState({ animating: true });
is called even beforethis.calculateMetrics();
thus the static text with center aligned opacity is set to0
and show ScrollView instead.This PR aims to solve this by calling
this.setState({ animating: true });
aftercontentFits
is known. And ifcontentFits
is true, instead of animating it, just leave it as is and callafter
duration
passed.Disclaimer
I don't actually test this because setting up environment is somehow not convenient and the paths in the
index.js
are entangled. So please test before accept or reject. If there is more time I will create PR for testing locally.