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

[BUG] - Original default variant is still applied when new variant is added with extendVariants #2957

Open
uiii opened this issue May 6, 2024 · 1 comment

Comments

@uiii
Copy link

uiii commented May 6, 2024

NextUI Version

2.3.6

Describe the bug

I am trying to add new variant for maxWidth to the Navbar component. My goal is to not set max-width to the wrapper slot and add the container class instead.

So I extended variants like this:

const CustomNavbar = extendVariants(Navbar, {
  variants: {
    maxWidth: {
      container: {
        wrapper: "container"
      }
    }
  },
  defaultVariants: {
    maxWidth: "container"
  }
});

But when I use the CustomNavbar the container class is successfully added to the wrapper slot, but the max-width from the original default variant (lg) is there as well.

image

Even if I specifically set the maxWidth="container" prop it doesn't help.

Your Example Website or App

https://codesandbox.io/p/devbox/cocky-microservice-dszkmp?file=%2FApp.jsx%3A21%2C20

Steps to Reproduce the Bug or Issue

See the bug description and codesandbox.

Expected behavior

The original default variant is not applied of the different one is set.

Screenshots or Videos

No response

Operating System Version

Windows 10

Browser

Chrome

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