Skip to content

Commit

Permalink
turbo:before-render works more reliably
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemanrubia committed Dec 25, 2024
1 parent c4b70a1 commit 9b46e25
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/hotwire_spark.js
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ var HotwireSpark = (function () {
await this.#visitCurrentPage();
}
#maintainScrollPosition() {
document.addEventListener("turbo:render", () => {
document.addEventListener("turbo:before-render", () => {
Turbo.navigator.currentVisit.scrolled = true;
}, {
once: true
Expand Down
Loading

0 comments on commit 9b46e25

Please sign in to comment.