Skip to content

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

Closed

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

  1. colinrotherham commented on Sep 9, 2025

    @colinrotherham
    Collaborator

    @edwardhorsford @rowellx68 Can you see if I've fixed this in #267?

  2. edwardhorsford commented on Sep 10, 2025

    @edwardhorsford
    ContributorAuthor

    I can see disableErrorLine is no longer present.

    Will there be related changelogs / upgrade notes for these things that have been removed / changed? This alone could be a breaking change.

  3. colinrotherham commented on Sep 10, 2025

    @colinrotherham
    Collaborator

    Yeah here's the Upgrading to 6.0 guide from #267

    Fieldsets are no longer necessary in the sense that, if a component wants one, it does it itself

    - <Fieldset>
    -   <Fieldset.Legend>Have you changed your name?</Fieldset.Legend>
    -   <Radios>
    +   <Radios legend="Have you changed your name?">
    -     <Radios.Radio value="yes">Yes</Radios.Radio>
    -     <Radios.Radio value="no">No</Radios.Radio>
    +     <Radios.Item value="yes">Yes</Radios.Item>
    +     <Radios.Item value="no">No</Radios.Item>
        </Radios>
    - </Fieldset>
  4. edwardhorsford commented on Sep 10, 2025

    @edwardhorsford
    ContributorAuthor

    I don't see disableErrorLine being mentioned in the guide - should we mention that it's been removed?

  5. colinrotherham commented on Sep 10, 2025

    @colinrotherham
    Collaborator

    I don't see disableErrorLine being mentioned in the guide - should we mention that it's been removed?

    Yeah, for people that forget to remove <Fieldset>?

    It's still there on every form component and the <SingleInputFormGroup> <FormGroup> wrapper

  6. colinrotherham commented on Sep 29, 2025

    @colinrotherham
    Collaborator

    Since every component that uses <FormGroup> can set/unset its own error we no longer need disableErrorLine

    Confirming it's closed by #267 and the guide has been updated

  7. added this to the v6.0.0 milestone on Oct 1, 2025
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