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

When using wire:navigate data-sashed is not set after navigation #323

Open
lloydowen opened this issue Oct 5, 2024 · 0 comments
Open

When using wire:navigate data-sashed is not set after navigation #323

lloydowen opened this issue Oct 5, 2024 · 0 comments

Comments

@lloydowen
Copy link

lloydowen commented Oct 5, 2024

Hey,

Hard to explain what's going on, but when using wire:navigate with sidebar navigation an empty container appears where the sidebar would be.

I've noticed when using wire:navigate the data-stashed attribute has been removed on the sidebar. On hard refreshes this works fine.

It looks like this when navigating with wire:navigate set:

Image

I have noticed it's likely something to do with x-bind:data-stashed="! screenLg"

<div 
class="[grid-area:sidebar] z-[1] flex flex-col gap-4 [:where(&amp;)]:w-64 p-4 max-lg:[&amp;[data-mobile-cloak]]:hidden [[data-show-stashed-sidebar]_&amp;]:!translate-x-0 lg:!translate-x-0 !z-20 data-[stashed]:!left-0 data-[stashed]:!fixed data-[stashed]:!top-0 data-[stashed]:!min-h-dvh data-[stashed]:!max-h-dvh lg:hidden bg-zinc-50 dark:bg-zinc-900 border-r border-zinc-200 dark:border-zinc-700 transition-transform" 
x-bind:data-stashed="! screenLg"
 x-resize.document="screenLg = window.innerWidth >= 1024" 
x-init="$el.style.transform = 'translateX(-100%)'; $el.removeAttribute('data-mobile-cloak'); $el.classList.add('transition-transform')" x-data="{ screenLg: true }"
 data-flux-sidebar="" 
style="transform: translateX(-100%);" 
data-stashed="true">

But after wire navigating that attribute is missing completely.

This only seems to happen when setting the responsive browser to iPhone 14 Pro Max.

A temporary fix i've permanently set the stashed attribute:

<flux:sidebar stashable x-bind:data-stashed="true"></flux:sidebar>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant