Skip to content

Carousel issue when at last slide #1098

Open

Description

@aleksboch

When I use a component (copy and paste html code from your docs website) with carousel controls (static). ie. testimonial or related articles - the last 'slide' needs to be clicked twice to move back to the beginning? When it's set to auto 'slide' the last slide remains visible for double duration

When this happens each carousel item has two z classes. eg z-30 and z-10

If I include <script src="https://cdn.tailwindcss.com"></script> in the head, then it works perfectly. It's my understanding I do not need to use this script, if using flowbite as a package?

I am building with vite and using flowbite and tailwind as packages - following the quick start installation method in your documentation.

Activity

  1. marcelbusch commented on Dec 12, 2025

    @marcelbusch

    having the same issue, the z-XX classes aren't removed properly, so the carousel items all keep the z-30 class, which leads to the last element being visible over the first element when it should be behind it
    i am on flowbite 4.0.1

  2. marcelbusch commented on Dec 12, 2025

    @marcelbusch

    quickfix would be using the javascript api and giving

    onChange: (s) => {
      s?._carouselEl.querySelector('.z-10.z-30')?.classList.remove('z-30')  
    },

    as an option

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions