Skip to content
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

Turbo morph displays progress bar #1211

Open
rbclark opened this issue Mar 1, 2024 · 2 comments
Open

Turbo morph displays progress bar #1211

rbclark opened this issue Mar 1, 2024 · 2 comments

Comments

@rbclark
Copy link

rbclark commented Mar 1, 2024

First of all, the new morphing feature feels extremely seamless whenever a refresh is triggered. If it weren't for the progress bar, I'm not even sure I'd know that it was happening. As an end user of an app that utilizes morphing it is likely not necessary and is instead potentially distracting to see a refresh bar appear when they aren't even expecting the page to refresh. Is there any way to disable the progress bar for page morph actions?

@omarluq
Copy link
Contributor

omarluq commented Mar 23, 2024

@jorgemanrubia thoughts on this proposal? I think it would be beneficial to allow users to disable the progress bar both globally and at the frame/stream level. This would provide greater flexibility in managing user experience.
Example:

// Turns off the progress bar globally
Turbo.progressBar = 'off';
<turbo-stream action="refresh" target="example_target" progress-bar="off">
  <template>
    <!-- Content updates here won't trigger the progress bar -->
  </template>
</turbo-stream>

<turbo-frame id="example_frame" progress-bar="off">
  <!-- Content here won't trigger the progress bar when loading -->
</turbo-frame>

@omarluq
Copy link
Contributor

omarluq commented Mar 23, 2024

across the board control can also be achieved with an attribute on the turbo-refresh-method meta tag instead of JS config e.g.

<meta name="turbo-refresh-method" content="morph"  progress-bar="off">

or a new meta tag for the progress bar only e.g.

<meta name="turbo-progress-bar" content="off">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants