-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Reduce uninitialised UI flashes and reflows #1486
Conversation
packages/admin/resources/views/components/layouts/app/sidebar/group.blade.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor things right now - general idea is good though. Let's see how far you can get with it, thanks @jacksleight!
Also - are there unintended side effects of setting the initial |
Great, I'll make those tweaks and continue with the remaining bits. I'm not too sure about the empty |
…group.blade.php Co-authored-by: Ryan Chandler <ryangjchandler@gmail.com>
Co-authored-by: Ryan Chandler <ryangjchandler@gmail.com>
Co-authored-by: Ryan Chandler <ryangjchandler@gmail.com>
I think I’ve got this about as far as I can, shout if you spot anything I’ve missed. These items are intentionally excluded, as implementing them reliably is probably more work than it’s worth, or just not possible:
There are a couple of things I’m a little unsure of that you may want to review:
|
Thank you so much! These are great. |
Related to my previous sidebar PR, this reduces uninitialised UI flashes and reflows on page load in a few other spots, to make things feel a little snappier and smoother. The goal is to make the initial render before JS initialisation as close as possible to how it looks after initialisation, within reason. The video below demonstrates what I'm referring to (after the changes is around the half-way point):
Screen.Recording.2022-02-07.at.17.37.24.mov
These pre-initialisation UI changes have been implemented:
scrollHeight
calculation, which wasn't taking the border into accountThis won't be able to cover absolutely everything. Some things probably aren't worth the hassle of pre-rendering server side, like the initial value/state of a multi-select. And some things simply aren't known server side, like the scroll height of a textarea. But I think even just these changes make things feel much smoother.