Skip to content

Setting required="true" on a <UFormField> should also set it's child required to true #4529

@wanicolas

Description

@wanicolas

Description

While using NuxtUI (which is awesome btw <3 ) , I understood that you can set the "required" prop to any form element on itself directly without using it in a <UFormField>. And that's great because you don't always need a label or you can set it as required without having the asterisk on it's label.

But I think that when you set "required" directly on the <UFormField>, it's child should be required too (and having "required" in the DOM too) as I don't see any reason it shouldn't ; and also it's repetitve to set it to both components. Correct me if I am missing something or if there's a reason for it !

Additional context

Here is an example on the NuxtUI website where a <UFormField> is required but it's <UInput> child is not set required in the DOM :
Image
The input rendered in the DOM :
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv3#1289

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions