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

Polling: vanilla js has code that runs before document has finished loading #128

Closed
villu164 opened this issue Sep 25, 2020 · 2 comments · Fixed by #130
Closed

Polling: vanilla js has code that runs before document has finished loading #128

villu164 opened this issue Sep 25, 2020 · 2 comments · Fixed by #130

Comments

@villu164
Copy link
Contributor

https://github.com/renderedtext/render_async/blob/b33fd38533640f1a871ec4b89e2bc30ffef55832/app/views/render_async/_request_vanilla.js.erb#L119-L146

<% if interval %>
...
  var container = document.getElementById('<%= container_id %>');

  // Register a polling stop event on the container
  container.addEventListener("async-stop", _clearRenderAsyncInterval)

This in turn makes vanilla js work only by doing the usual js-files at the bottom of the body

@nikolalsvk
Copy link
Owner

Got it, we should make this happen after the document is ready. Thanks for opening the issue, @villu164.

@nikolalsvk
Copy link
Owner

Hey, @villu164. I released a fix for this in the 2.1.8 version. Let me know if it is fixed for you.

Cheers 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants