Skip to content

bug: Floating Label overlays the drawer component #3929

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

Open
kensodemann opened this issue May 30, 2025 · 3 comments · May be fixed by #3932
Open

bug: Floating Label overlays the drawer component #3929

kensodemann opened this issue May 30, 2025 · 3 comments · May be fixed by #3932

Comments

@kensodemann
Copy link

Reproduction URL (Required)

https://github.com/kensodemann/show-floating-labels

What version of daisyUI are you using?

5.0.43

Which browsers are you seeing the problem on?

All browsers

Describe your issue

I have an application that has some forms using floating labels. I also have a drawer menu to the left. On smaller form factors, this drawer is opened via a hamburger menu. If this takes place while there is data in the inputs, and thus the labels are floating, they float above the drawer.

I have reproduced this in a simple app. To replicate, run the (see instructions in README.md file), fill in some of the inputs so at least one of the labels floats, then open the drawer using the hamburger menu. You should see the floating labels float above the menu.

Inputs with the labels floating:
Image

Labels floating over the drawer:
Image

I noticed the floating labels use a z-index of 2, and removing that solves this issue, but I have no idea if it causes other issues.

.floating-label {
    &:focus-within, &:not(:has(input:placeholder-shown, textarea:placeholder-shown)) {
        > span {
            opacity: 100%;
            top: 0;
            translate: -12.5% calc(-50% - 0.125em);
            scale: 0.75;
            pointer-events: auto;
            z-index: 2;
        }
    }
}
Copy link

Thank you @kensodemann for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

@sulimanbenhalim
Copy link
Contributor

@saadeghi assign this to me

@sulimanbenhalim
Copy link
Contributor

if removing the z-index:2 this is what it causes:

Image

so I increased the z-index of the drawer

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

Successfully merging a pull request may close this issue.

2 participants