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

Drawer not animating the entry when using on Remix Run #264

Open
chaitanyapilaka opened this issue Feb 8, 2024 · 7 comments
Open

Drawer not animating the entry when using on Remix Run #264

chaitanyapilaka opened this issue Feb 8, 2024 · 7 comments

Comments

@chaitanyapilaka
Copy link

Hi, I tried using Vaul with a newly created remix app. The code I used is straight from the read me.

  function MyComponent() {
    return (
      <Drawer.Root>
        <Drawer.Trigger>Open</Drawer.Trigger>
        <Drawer.Portal>
          <Drawer.Content>
            <p>Content</p>
          </Drawer.Content>
          <Drawer.Overlay />
        </Drawer.Portal>
      </Drawer.Root>
    );
  }

Unfortunately, the entry animation doesn't work but the slide down works as expected with an exit animation. Is there something I need to do with remix to make it work?

@emilkowalski
Copy link
Owner

Can you provide a codesandox with reproduction?

@akamfoad
Copy link

I have the same problem, it was working correctly when I was using Vite on it's own, but when migrated to Remix SPA it the entry functionality broke.

Here is a codesandbox And here is the repo

@akamfoad
Copy link

After doing some research, looks like the vaul stylesheet is not included in the stylesheets, I imported the stylesheet and now it works fine

Importing as stylesheet handled by Remix:

import "vaul/dist/index.css";

Importing as URL and rendering the link yourself:

// import
import vaulStyles from "vaul/dist/index.css?url";

// render in root 
<link href={vaulStyles} rel="stylesheet" />

@the-dream-machine
Copy link

Thanks @akamfoad. Was able to get it working by importing the styles in the root:

// app/root.tsx

import VaulStyles from "vaul/dist/index.css";

export const links: LinksFunction = () => [
  { rel: "stylesheet", href: VaulStyles }
  // ...other stylesheets
];

@ParkerMJones
Copy link

It looks like vaul/dist/index.css no longer exists in v0.9.1. I've got it working again by copying the contents of vaul/dist/index.css from v0.9.0, saving it in my own vaul.css and referencing that file in the same way @the-dream-machine is above. Allows me to upgrade to 0.9.1 but retain this solution.

@akamfoad
Copy link

Indeed @ParkerMJones looks like it's no longer there, it would be great to report this in a new issue so it gets more attention, not sure this is intentional as there is no mention in the release notes.

@akamfoad
Copy link

@ParkerMJones I went ahead and opened #357 to make sure this gets the attention it needs

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

5 participants