I'm using Symfony 6.2 with Turbo UX and Stimulus. I'm trying to code a single page app. In the /symfony-app/assets/app.js
, I load some libraries that are needed for a Symfony Bundle to work before doing import './bootstrap';
to load Stimulus.
Everything works smoothly on the first fresh page load. Then, when I use the sidebar navigation menu to go to another page, the DOM elements from the sidebar <aside>
loses their added events (this is expected, Turbo makes nodeClones()), but not the elements from the navigation bar <nav>
. Both elements are children of <body>
.
This DOM elements are defined on the same template from which every sidebar navigation element will load.
What am I missing? I would expect all events attached to DOM nodes to disappear...