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]: CarouselContent should be overflow-hidden w-full h-full not overflow-hidden #5402

Open
2 tasks done
softmarshmallow opened this issue Oct 16, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@softmarshmallow
Copy link

Describe the bug

In a scenario where carousel size is determined by the container, not the content (item) passing

<CarouselContent className="w-full h-full">

won't work since the className is accepted by the second child

const CarouselContent = React.forwardRef<
  HTMLDivElement,
  React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => {
  const { carouselRef, orientation } = useCarousel()

  return (
    <div ref={carouselRef} className="overflow-hidden">
      <div
        ref={ref}
        className={cn(
          "flex",
          orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
          className
        )}
        {...props}
      />
    </div>
  )
})

I am trying to use carousel in a definitive grid, and grid area, where content should follow the sizing, as the size is overriden (ignored by CarouselContent, I think its a wrong design. (or at least make it more atomic or allow className separation)

Affected component/components

Carousel

How to reproduce

<CarouselContent className="w-full h-full">

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

MacOS

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@softmarshmallow softmarshmallow added the bug Something isn't working label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant