You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue when using this gem. I'm building a project with Rails 6 and Turbolinks 5.2.1, which I sadly can't share at the moment. When I enter a page with an .administrate-jsoneditor or .administrate-jsoneditor-viewer element, the editor would load correctly, but ends up generating multiple copies once I leave and revisit the page.
I suspect that Turbolinks triggers the turbolinks:load event every time I visit the page, but also keeps the modified DOM between visits, generating multiple copies of the editor after repeated visits.
Sorry for not preparing an example showcasing the problem, but I'm short on time. I hacked together a workaround on this fork, which solves the problem by stopping the creation of a new editor if there's already one present. My solution is not robust at all and the commits were written on a hurry, so it would be better to consider an alternative fix.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
I encountered an issue when using this gem. I'm building a project with Rails 6 and Turbolinks 5.2.1, which I sadly can't share at the moment. When I enter a page with an
.administrate-jsoneditor
or.administrate-jsoneditor-viewer
element, the editor would load correctly, but ends up generating multiple copies once I leave and revisit the page.I suspect that Turbolinks triggers the
turbolinks:load
event every time I visit the page, but also keeps the modified DOM between visits, generating multiple copies of the editor after repeated visits.Sorry for not preparing an example showcasing the problem, but I'm short on time. I hacked together a workaround on this fork, which solves the problem by stopping the creation of a new editor if there's already one present. My solution is not robust at all and the commits were written on a hurry, so it would be better to consider an alternative fix.
Thanks!
The text was updated successfully, but these errors were encountered: