Can a turbo-frame be used isolated just on one page without the whole site using turbo-drive and with the javascripts at end of body element? #2578
Unanswered
gewait
asked this question in
Questions & Answers
Replies: 1 comment
-
You should have check the resources given by the message: https://turbo.hotwired.dev/handbook/building#working-with-script-elements. You can read on that page:
If it still doesn't matter enough for you you can Suppress this warning by adding a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The Situation:
I just want to use a turbo-frame in one page without using turbo-drive or other turbo-features throughout the application.
I installed "symfony/ux-turbo" and disabled turbo globally in the body element with
<body data-turbo="false">
.On one page i have a div with a turbo-frame in it, which enables turbo just for this div with
<div data-turbo="true">
.The turbo-frame is basically an CRUD index page with a table of entities and a knp-paginator and it can paginate and refresh without a complete page reload. The knp-paginator links are converted to ajax calls and the turbo-frame refreshes.
This seems to work.
The Problem/Question:
Because my javascripts are located at the end of the body element i get a warning in the console:
I understand that turbo-drive, when enabled globally, changes your page reloads and does a lot of magic and needs your javascript out of the body.
Question: Does the warning apply to my situation when i only use this one turbo-frame and not using turbo globally?
i still have my normal page reloads, its only inside the turbo-frame that links get translated into ajax calls.
Can i leave my javascript at the end of the body element? What sideeffects can happen?
Beta Was this translation helpful? Give feedback.
All reactions