ddnexus / pagy

🏆 The Best Pagination Ruby Gem 🥇
https://ddnexus.github.io/pagy
MIT License
4.57k stars 407 forks source link

Multiplicated navs with `hotwired/turbo` cache #350

Closed Gee-Bee closed 2 years ago

Gee-Bee commented 2 years ago

Prerequisites:

Steps to reproduce the problem:

  1. open a page with a nav
  2. click a link (navigate to another page with turbo)
  3. use browser's back button - there are two navs on a page now
  4. go back to step 2. to see more navs

Problem didn't exist in version 4.11, because the content of the nav element was emptied here. This was removed in 5.0.0.

Is this change intentional? If that's the case, maybe there should be some information in the docs about the need of empty the nav element manually using turbo:before-cache event?

ddnexus commented 2 years ago

It was unintentionally merged during a cleanup! Fix released in 5.6.4. Thank you!

benkoshy commented 2 years ago

I did not notice the reversion on the demo app.