Hi,
I have this simple snippet of code:
document.addEventListener("turbo:load", function () {
let filterBar = document.querySelector('.filter-bar');
if (filterBar) {
filterBar.querySelector('.filter-bar-title').addEventListener('click', () => {
filterBar.querySelector("sl-dialog").show();
});
}
});
When I do a fresh page load, i click the filter bar and it takes a while or so before it’s recognised and my sl-dialog component opens.
If I then navigate to another page (which has the same filter bar and dialog), the dialog never opens and the click is not recognised.
Is there a solution to this? Am I doing something wrong?