Skip to content

Commit

Permalink
Fix: Missing loading animation when loading multiple turbo frames in …
Browse files Browse the repository at this point in the history
…a fast way (#911)

* fix white page issue when load multiple turbo frames

* replace settimeout of 0 by requestAnimationFrame
  • Loading branch information
Bilelkihal authored Jan 14, 2025
1 parent 2f40a39 commit 5f2d7cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/javascript/controllers/turbo_frame_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ export default class extends Controller {
}

this.urlValue = this.#updatedPageUrl(data)

this.frame.src = this.urlValue

requestAnimationFrame(() => {
this.frame.setAttribute('busy', 'true');
});
}
}

Expand Down

0 comments on commit 5f2d7cc

Please sign in to comment.