Skip to content

Fieldset incorrectly gets set in error when a child input is in error #245

Description

@edwardhorsford

It seems like the fieldset component will set itself in error if one of the child inputs inside it is in error. This is not correct - it should only be in error if the fieldset as a whole is in error.

The result is that the left red error bar extends across the entire fieldset, rather than just the field that is in error.

You could possibly say that this is something to be decided on a question by question basis - but then this shouldn't be the default as it's not how the native components work.

It's not in the docs, but reading the package source, I see you can use <Fieldset disableErrorLine="false"> to explicitly disable this.

Incorrect:
Screenshot 2024-07-15 at 13 46 35

Correct:
Screenshot 2024-07-15 at 13 58 07

There's no example of this in the NHS design system, but it's covered in the GOV.UK design system:
Screenshot 2024-07-15 at 13 58 58

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions