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

Unable to get Turbo Drive to work properly with the DaisyUI drawer component (input checked state) #1370

Open
gremo opened this issue Feb 25, 2025 · 0 comments

Comments

@gremo
Copy link

gremo commented Feb 25, 2025

I have to admit, I'm pretty new to Turbo Drive, but I think I understand the basics and how it works.

I'm using Turbo Drive (v. 8.0.12) with the following settings:

  <meta name="turbo-refresh-method" content="morph">
  <meta name="view-transition" content="same-origin" />
  <meta name="turbo-prefetch" content="false">

Now, onto the issue. Here’s how my application is structured (I'll show the important parts). The drawer component from DaisyUI has the following structure:

<body>
    <div class="drawer">
        <input id="mydrawer" class="drawer-toggle" type="checkbox"><!-- checked state will make <aside> visible -->
        <div class="drawer-content">
            <header id="header" data-turbo-permanent>
                <label for="mydrawer" class="btn">Open drawer</label>
             </header>
            <!-- page content (<main>, <footer>, etc) -->
        </div>
        <aside id="aside" class="drawer-side" data-turbo-permanent>
            <label for="mydrawer" class="drawer-overlay" aria-label="Close drawer"></label>
            <!-- menu links (Home, etc.) -->
        </aside>
    </div>
</body>

Image

With this setup, I have no problems at all interacting with <footer> links. The problems arise when:

  1. I click a footer link i.e "Virtual card"
  2. I open the drawer and click another page i.e. Home
  3. I return to the page at 1. "Virtual cards" in this example

As you can see, the drawer reopens by itself for a moment, then the target link's content is morphed. It seems to me that when I click back to Home, the checked state of the input is somehow "restored" (why?). That's the reason the drawer will briefly show. Then, as the content of the target page is fetched and morphed, the not.checked state is replaced.

Working NOT working / glitch
Image Image

I sincerely thank in advance anyone who can help me understand whether this is normal behavior, a bug, or if I have misconfigured something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant