jcgertig / react-text-marquee

A <marquee> component for react.
MIT License
8 stars 5 forks source link

Text suddenly accelerates #1

Open AlistairHardy opened 6 years ago

AlistairHardy commented 6 years ago

<Marquee leading={2000} trailing={2000} hoverToStop loop text={list.title.toUpperCase()} />

For some reason, it will randomly start accelerating to a much higher speed, making it unreadable and looking messy. This is sat inside of a props.map()

react version 16.2.0

Chrome is the web browser I'm testing in

ronaldporch commented 6 years ago

Came to report the same thing. Noticed it around the same time you made this issue.

oleszczyk commented 6 years ago

Same problem here. I have found fast fix. Go to file node_modules/react-text-marquee/lib/index.js, and comment this.setState({ animatedWidth: 0 }); in line 191.

So the section should be:

      key: 'componentWillReceiveProps',
      value: function componentWillReceiveProps(nextProps) {
        if (this.props.text.length !== nextProps.text.length) {
          clearTimeout(this.marqueeTimer);
          //this.setState({ animatedWidth: 0 });
        }
      }
Skytrobb commented 5 years ago

That fix does not seem to work. Still getting start and stop acceleration