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: input with label wrong html code #15

Open
michaelcozzolino opened this issue Oct 19, 2024 · 3 comments
Open

bug: input with label wrong html code #15

michaelcozzolino opened this issue Oct 19, 2024 · 3 comments

Comments

@michaelcozzolino
Copy link

michaelcozzolino commented Oct 19, 2024

What version of FlyonUI are you using?

No response

Which browsers are you seeing the problem on?

All browsers

Reproduction URL

https://flyonui.com/docs/forms/file-input/#label

Describe your issue

the snippet provided, even if fully working is not completely right:

<label class="form-control w-96">
  <div class="label">
    <span class="label-text">Full name</span>
  </div>
  <input type="text" placeholder="John Doe" class="input" />
</label>

should be

<div class="form-control w-96">
  <label class="label">
    <span class="label-text">Full name</span>
  </label>
  <input type="text" placeholder="John Doe" class="input" />
</div>

some other snippets are affected as well.

Copy link

Hi @michaelcozzolino

Thank you for your support in helping us improve FlyonUI!

We’ve received your submission and will respond within few business days. Our team handles issues one at a time, and we’ll be reviewing yours as soon as possible.

In the meantime, any additional details or a reproducible example would be greatly appreciated and will help us resolve the issue more efficiently.

Thank you for your patience and understanding!

@OmkarOza
Copy link
Member

Hi @michaelcozzolino,

Thank you for your feedback. The reason we used the first method, wrapping the entire form control in a <label>, was to handle a more complex layout. This approach ensures that all label-related elements, including additional spans and helper texts, are directly tied to the input field, allowing for a seamless user experience. It also enhances click behavior, making any part of the label area focus the input, and simplifies the HTML structure by avoiding redundant for and id attributes.

@michaelcozzolino
Copy link
Author

understood, but according to the html specification that html you used is not valid as described here

furthermore according to your reason, both codes shown on the docs should be the same in terms of structure
image
but they are not. is it wanted?

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

No branches or pull requests

2 participants