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: V5 - Using a Floating Label with a disabled input looks weird. #3381

Open
whitetxt opened this issue Jan 14, 2025 · 3 comments
Open

bug: V5 - Using a Floating Label with a disabled input looks weird. #3381

whitetxt opened this issue Jan 14, 2025 · 3 comments
Assignees
Labels

Comments

@whitetxt
Copy link

whitetxt commented Jan 14, 2025

What version of daisyUI are you using?

v5.0.0-beta.1

Which browsers are you seeing the problem on?

Chrome, Firefox (Probably all browsers, I just can't confirm)

Reproduction URL

https://play.tailwindcss.com/PZRBzuF7sJ

Describe your issue

When using a Floating Label, if the input is disabled then it is possible to see through the input to the label behind it, which doesn't line up perfectly and therefore looks weird.

This only happens with a disabled input WITHOUT a value, if the input has a value then it works as expected.

Example in the Tailwind Play page.

Copy link

Thank you @whitetxt 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.

@saadeghi saadeghi self-assigned this Jan 14, 2025
@whitetxt
Copy link
Author

whitetxt commented Jan 14, 2025

I've found adding the following to the tailwind input fixes this, I feel like using "hidden" is a bad decision though.

.floating-label {
    &:has(input:disabled:placeholder-shown) {
        > span {
            @apply hidden;
        }
    }
}

https://play.tailwindcss.com/9WQ2pRV28E

@saadeghi
Copy link
Owner

saadeghi commented Jan 14, 2025

It will be fixed in 5.0.0-beta.2 this week.

@saadeghi saadeghi added the v5 label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants