Open suan opened 4 years ago
This should work fine with turbolinks. The start function adds listeners to the document that then check the event target and use that to find or initialize the form controllers so the form/drag and drop field can enter the dom at any time. The start status is cached to prevent adding the event listeners to the dom more than once.
First off thanks for this library!
Looks like the JS for this library assumes the target element is already present on the page, at the time application.js is executed -- however this doesn't work with Turbolinks as application.js will only get executed on the very first request, and so if the dnd-target is not present until a later navigation, the library doesn't get activated.
Worse so, since the
start
status is cached, even attempts to force-callstart()
to bind after aturbolinks:load
doesn't work.Would be great to get some better Turbolinks integration given its been the default in Rails 5 and up...