Skip to content

Conversation

@archieherbias
Copy link

Bug was caused by setting the visibleChars state twice when prop typingis changed.

Solution is to clear the _handleTimeout from running so that changing state won't fire twice.

@archieherbias
Copy link
Author

Demo for the fix:
Demo

const active = this.props.typing;

if (active > 0 && next < 0) {
clearInterval(this._timeoutId);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition block here causes setting of visibleChars state to fire twice along with the _handleTimeout handler. So, clearing _handleTimeout is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant