-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
progressBarDelay not working when Back press #1058
Comments
I'm seeing this same issue as well. Why was this closed? @risinginsider Did you find a workaround? |
@jaredcwhite I am using nprogress to get full control over the progress bar. https://github.com/rstacruz/nprogress/ |
Workaround in case someone is interested: let turboPopstateProgressBarTimeoutId;
window.addEventListener('popstate', (event) => {
if (event.state.turbo) {
Turbo.session.adapter.progressBar.progressElement.hidden = true;
if (turboPopstateProgressBarTimeoutId) {
clearTimeout(turboPopstateProgressBarTimeoutId);
}
turboPopstateProgressBarTimeoutId = setTimeout(() => {
Turbo.session.adapter.progressBar.progressElement.hidden = false;
}, Turbo.session.progressBarDelay);
}
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I set progress bar delay to 2000 by changing this.progressBarDelay(500 to 2000). Turbo cache control no cache. It works when visiting new pages by clicking links or forms. But if back button pressed, Progress bar immediately showing instead of 2000 delay. Additionally, tried Turbo.setProgressBarDelay(2000); but not working on back press.
The text was updated successfully, but these errors were encountered: