Skip to content

Commit

Permalink
fix: temporary fix for turbo bug with lazy loading (#3160)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Aug 21, 2024
1 parent 73c393d commit e352dee
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/javascript/avo.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ document.addEventListener('turbo:load', () => {

document.addEventListener('turbo:frame-load', () => {
initTippy()

// Handles turbo bug with lazy loading
// https://github.com/hotwired/turbo/issues/886
// Remove when PR https://github.com/hotwired/turbo/pull/1227 is merged
document
.querySelectorAll('turbo-frame[loading="lazy"][complete]')
.forEach((frame) => frame.removeAttribute('loading'))
})

document.addEventListener('turbo:before-fetch-response', async (e) => {
Expand Down

0 comments on commit e352dee

Please sign in to comment.