Laravel-Backpack / CRUD

Build custom admin panels. Fast!
https://backpackforlaravel.com
MIT License
3.08k stars 885 forks source link

[Bug] On desktop, sidebar flickers into view for 1 sec before hiding #3482

Closed tabacitu closed 3 years ago

tabacitu commented 3 years ago

Bug report

What I did

On desktop, closed the sidebar.

What I expected to happen

Stay closed as I browse across the admin panel without using the sidebar.

What happened

The sidebar does stay get closed (its closed state is correctly stored in localStorage and then on pageload it gets closed). But before that happens, it's visible for a second. So as you browse around without using the sidebar, everything feels a bit awkward:

2021-01-26 12 05 05

What I've already tried to fix it

I remember we fixed this before, at some point (perhaps in 3.x or 4.0) but like Terminator... it's back. I assume it's because the JS doesn't get loaded fast enough. That the first paint shows the sidebar, then JS hides it.

I thought maybe if we move the JS to before_scripts the performance will be better, tried it but it didn't help... we still get the flicker...

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

### PHP VERSION:
PHP 7.4.13 (cli) (built: Nov 30 2020 14:57:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies

### LARAVEL VERSION:
v8.22.1@5c70991b96c5722afed541a996479b5112654c8b

### BACKPACK VERSION:
4.1.30@62856b1f01fc3e05c80140fc22f85ea2aac8368c
promatik commented 3 years ago

I'm on it ✌

promatik commented 3 years ago

@tabacitu I've just open a PR with which I think it is the best way to solve this issue; https://github.com/Laravel-Backpack/CRUD/pull/3484