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 have put a countdown timer on the sidebar between a div
<div id="timer" data-turbo-permanent>
<!-- timer here -->
</div>
When I start clicking links... the countdown timer keeps the same numbers again and again which is fantastic,
but if I keep clicking different links in the navbar then other links in the sidebar (I just keep clicking and clicking for a while) at certain moment the page gets reloaded and the timer stops and gets back to it's original state,
if I click the same link many times, it gives the same behavior so it's not a matter of clicking different links or same link!
I thought maybe it's because I'm clicking links continuously very quick so I tried to click at a lower rate, but it happens regardless whether I click fast or a little slower, after many clicks the page gets reloaded!
is this something expected to happen in this case? or it's a bug maybe?
Update: not sure but in the dev console whenever this happens I see something like:
Uncaught (in promise) DOMException: The user aborted a request. VM3761 turbo.es2017-esm.js:347
when I click on it, it comes from turbo js file and all it gives me is : TypeError: Cannot read property 'requestContent' of undefined
UPDATE 2 If my finding is correct, there is a function called async perform() at line 323, here is the full function:
Now, the issue of page reloading disappeared completely, and my countdown timer never stops :) and the output of console.log(error) is showing me DOMException: The operation was aborted.
So yeah I think the issue is coming from there! would commenting these lines out (for now) cause any issue? and is that something that would be corrected?
Another issue related to the events of data-turbo-permanent element:
By commenting the above lines in the catch block solved the issue of reloading the page (specifically the elements with data-turbo-permanent), I started noticing that my timer numbers get frozen once the catch block gets hit, so I think that part should be corrected, please if anyone have a quick fix I will be very thankful.
I confirm that going back to turbolinks and using data-turbolinks-permanent works perfectly, all the described issue above happens only with turbo
The text was updated successfully, but these errors were encountered:
scratchoo
changed the title
data-turbo-permanent elements get reloaded after many link clicks
data-turbo-permanent elements (the whole page in general) get reloaded after many link clicks
Apr 6, 2021
I have put a countdown timer on the sidebar between a div
When I start clicking links... the countdown timer keeps the same numbers again and again which is fantastic,
but if I keep clicking different links in the navbar then other links in the sidebar (I just keep clicking and clicking for a while) at certain moment the page gets reloaded and the timer stops and gets back to it's original state,
if I click the same link many times, it gives the same behavior so it's not a matter of clicking different links or same link!
I thought maybe it's because I'm clicking links continuously very quick so I tried to click at a lower rate, but it happens regardless whether I click fast or a little slower, after many clicks the page gets reloaded!
is this something expected to happen in this case? or it's a bug maybe?
Update: not sure but in the dev console whenever this happens I see something like:
Uncaught (in promise) DOMException: The user aborted a request. VM3761 turbo.es2017-esm.js:347
when I click on it, it comes from turbo js file and all it gives me is : TypeError: Cannot read property 'requestContent' of undefined
UPDATE 2 If my finding is correct, there is a function called async perform() at line 323, here is the full function:
The error is coming from the CATCH block, I commented both lines and replaced them like follows:
Now, the issue of page reloading disappeared completely, and my countdown timer never stops :) and the output of console.log(error) is showing me DOMException: The operation was aborted.
So yeah I think the issue is coming from there! would commenting these lines out (for now) cause any issue? and is that something that would be corrected?
Another issue related to the events of data-turbo-permanent element:
By commenting the above lines in the catch block solved the issue of reloading the page (specifically the elements with data-turbo-permanent), I started noticing that my timer numbers get frozen once the catch block gets hit, so I think that part should be corrected, please if anyone have a quick fix I will be very thankful.
I confirm that going back to turbolinks and using data-turbolinks-permanent works perfectly, all the described issue above happens only with turbo
The text was updated successfully, but these errors were encountered: