-
Notifications
You must be signed in to change notification settings - Fork 44
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
Improve Initial Render Behavior for Stashable Sidebar #901
Comments
@mimin100 thanks for reporting! I'm unable to replicate this issue. When I test it locally, whether I set my browser to be on a slow 3G connection or normal, with javascript disabled and enabled, I'm unable to get the flash of the sidebar that you are describing. Any chance you could provide some more details on how we can replicate this issue? Can you please provide a layout file and a Volt component that I can use that demonstrates the issue as well as step by step instructions on how to trigger it/ see it? Thanks! |
@joshhanley Thanks for looking into this! I've created a bare minimum layout and a Volt component where the issue persists, regardless of the browser or connection speed. It happens consistently during page load—the sidebar is initially rendered in an expanded state and then gets "stashed" after the fact. There aren't any specific steps to reproduce the issue other than simply loading the page. Below, I've included the layout file and the Volt component I used for testing. Let me know if you need further clarification or additional details. Layout File
Volt component:
To better illustrate the behavior, I've also attached a GIF showing the issue. |
@mimin100 thanks! Will have a look after the holidays 🙂 |
Flux version
v1.0.29
Livewire version
v3.5.17
What is the problem?
The current behavior of the stashable sidebar causes an unpleasant visual jump during page load. When the page initially loads, the sidebar is rendered in its fully expanded state before being stashed based on the stored or default state. This results in a brief but noticeable layout shift that can disrupt the user experience.
Code snippets
How do you expect it to work?
The sidebar should honor its stashed state from the very beginning of the render process, avoiding any noticeable layout shifts.
Proposed Solution:
Instead of applying translateX(-100%) inline via the x-init hook, the stashed state should be handled with a Tailwind CSS class like -translate-x-full from the beginning.
(Excerpt from flux-pro/stubs/resources/views/flux/sidebar/index.blade.php)
So instead of
A solution could be
Please confirm (incomplete submissions will not be addressed)
The text was updated successfully, but these errors were encountered: