Fix a bug caret animation.