How to stop the navigation sidebar from appearing right after login on mobile?
Hi my client keep complain about this issue non stop, but I can't find any panel methods to stop the navigation sidebar from appearing right after login/register on mobile for filament v3.
It only happen on 1st time customer after login/register, subsequent login this did not happen it appears. But still it is a big issue to my client. As he feel he is losing customers when right after customer register/login they see this & keep blame me for it (he think they drop off after seeing this)
Is this a bug in filament v3 or some method i can call to fix this?
Thank you
10 Replies
I guess you need some custom JS overwrite the Alpine state. Not sure whether that's really possible
I just checked and I have the same problem, but it doesn't always happen, it only happens when you have the menu open and log out.
Inspecting the menu html, I have seen that it uses localStorage to know if the menu is open or closed.
You can fix it by adding the following:
it also happen to people who register on the site for the 1st time
may i ask what same-id should be?
may i ask what should be in same-id ? thank you
hi, it seem to work but whenever i composer update or deploy to my staging/production i get this error
U know what caused it?
guess i have to put what is in the ->html() into a file and reference that as the 2nd argument in ::make()
okay so the fix is as follow
The 2nd argument in make() is required, null or empty string will have error. when u composer update or install (during deploying). So just create an empty js file. then the script code in html(), if u put in the js file it will not work, so u will put that code inside ->html()
Also encountered the same problem, an alternative, which I think would work better, is to add this:
https://filamentphp.com/docs/3.x/support/render-hooks
if this fix could land in core that would be great
What fix? The last solution is correct it is a string.
if mean if the sidebar is auto closed on mobile when the page loads.
Sure, open a PR.
which file to edit? also i think Marc should get the credit
My bad. Though you were talking about the hook. Carry on. 😀