daisyui icon indicating copy to clipboard operation
daisyui copied to clipboard

nav button carousel z-index obscures dropdowns

Open bingalls opened this issue 3 years ago โ€ข 3 comments

Demo at https://play.tailwindcss.com/SHnMBFayGk

The other carousels work fine. If I place a navbar with dropdown menus https://daisyui.com/components/navbar/#responsive-dropdown-menu-on-small-screen-center-menu-on-large-screen (at a desktop breakpoint) just above a carousel with next/prev buttons https://daisyui.com/components/carousel/#carousel-with-nextprev-buttons the dropdown menu items are obscured behind the carousel. Note that this works fine at the mobile breakpoint. Problem also exists for a Card just below the NavBar menu.

I also had the same problem, when trying Tailwind Elements's carousel. FWIW, I use Astro.build

bingalls avatar Jul 04 '22 23:07 bingalls

@bingalls Did you ever find a solution for this? I am having the exact same issue and I also use Astro

bruddlee avatar Jul 18 '22 19:07 bruddlee

@bruddlee I did not find a solution; this is not an Astro problem. It looks to be a CSS z-index problem. Dropdowns also break for other DaisyUI components, Heros, as I recall. A quick hack would be to keep your drop-down menus short, and insert (well behaved) content between your navbar menus, and such troublesome DaisyUI components. Also, it helps to set the background-color for the transparent :hover menu items

bingalls avatar Jul 19 '22 02:07 bingalls

The ul that contains the sub-menus has a z-20 in the mobile version but not on the desktop. <ul className="p-2"> should add z-20 so it would look like this <ul className="p-2 z-20">

WickedInvi avatar Aug 18 '22 10:08 WickedInvi

I think this was fixed already. let me know if you have any questions.

saadeghi avatar May 29 '23 16:05 saadeghi