Skip to content

bug: isRequired attribute of FormItem component should trigger validation on form submission #944

@danibix95

Description

@danibix95

Component

FormItem@v0.25.0

Issue

When attribute isRequired is set to true the form item validation should be enabled. Unfortunately, this does not happen and it is necessary to explicitly set rules property to contain { "required": true } object to actually obtain the expected behavior.

Expected behavior

When attribute isRequired is set to true the form item validation is enabled and triggered upon form submission.

Replicate

  • Open the Storybook and search for the FormItem Required example
  • Clear the input element value and try to submit the form
  • As shown in the video, submitting an empty input still activate the callback and no validation is triggered
  • Upon adding [{"required": true}] in the rules property the validation is triggered and it prevents to submit an empty input value

Note: this behavior occurs also outside the Storybook (while using the component).

Screencast.from.15-05-2025.18.10.16.webm

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions