almo
almo

Reputation: 6387

turbo-progress-bar in Rails 7 does not hide after complete

I am using Rails 7 and Turbo. Rails 7 comes with the turbo-progress-bar, abar that shows a loading status if a page takes more than 500ms to load.

https://turbo.hotwired.dev/handbook/drive#displaying-progress

The bar shows and when I reaches 100% width it hides again. But on some of my pages it just keeps going:

<div class="turbo-progress-bar" style="width: 147.183%; opacity: 1;"></div>

...and going....

Does anyone know why this happens?

The docs also talk about [aria-busy="true"] when the page loads. This [aria-busy="true"] is removed after page load, but the the bar continues.

There is an issue in Github as well: https://github.com/hotwired/turbo-rails/issues/387

Upvotes: 5

Views: 737

Answers (1)

lcchatter
lcchatter

Reputation: 49

Nowadays In Rails 8, if I click on a link_to (a tag) calling a turbo action, this same issue happen. Workaround: use a button_to (button tag) in your view

Upvotes: 0

Related Questions