Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data-turbo-preview never added to html element #127

Closed
SleeplessByte opened this issue Feb 13, 2021 · 2 comments
Closed

data-turbo-preview never added to html element #127

SleeplessByte opened this issue Feb 13, 2021 · 2 comments

Comments

@SleeplessByte
Copy link

Version: .beta5

if (isPreview) {
  this.element.setAttribute("data-turbo-preview", "");
} else {
  this.element.removeAttribute("data-turbo-preview");
}

I've put a breakpoint at the first statement. When there is a page cached, I can see two renders:

  1. when the page starts navigating, this would be the preview, but isPreview is false
  2. when the page finishes navigating (after the progress bar + network request), and isPreview is false (as expected).

From the code, I think this is a bug, or I have missed additional instructions to enable the preview.

  • No no-preview set (I would not expect the first render to begin with)
  • No other options set via data-attributes. Just regular turbo-driven link to a cached page.

Is there anything I can provide to aid with determining what the issue is?

@SleeplessByte
Copy link
Author

Tracked by hotwired/turbo#159; should be fixed by hotwired/turbo#162 and hotwired/turbo#169.

This issue can be closed when released.

@dhh
Copy link
Member

dhh commented Apr 8, 2021

Closing as its tracked at the source.

@dhh dhh closed this as completed Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants