fixes jankiness with anchor tags in carousel.

Fixes #6760.