Skip to content

fix(Fieldset): Apply name and description correctly#4653

Open
TomasEng wants to merge 3 commits intodigdir:mainfrom
TomasEng:fix-name-and-description-on-fieldset
Open

fix(Fieldset): Apply name and description correctly#4653
TomasEng wants to merge 3 commits intodigdir:mainfrom
TomasEng:fix-name-and-description-on-fieldset

Conversation

@TomasEng
Copy link
Contributor

@TomasEng TomasEng commented Mar 20, 2026

Summary

When trying to update to the latest version of The Design System, I noticed that the fieldset description becomes a part of the element's name in the accessibility tree. This breaks several tests within Altinn Studio.


The images below shows how Chrome interprets it:
Screenshot of element inspection using Chrome's development tool
Screenshot of the computed properties in Chrome's development tool


This is how I expect the browser to interpret it:
Screenshot of the expected computed properties in Chrome's development tool


As it turns out, this happens because of code that only executes when a <ds-field> element is used. Consequently, the tests of the React Fieldset component run green because there is no <ds-field> in the test component. In this pull request, I have fixed this test and added some new ones to make sure this works as expected. Then I have fixed the code that causes the bug and split it up into smaller parts to make it more maintainable.

Note

I have tried to make every check pass, but I am not sure how to fix the preview deploy job. I believe it is out of my control since it fails on "az login". I believe this is also the reason why other checks are being skipped. I have run relevant automated tests locally.

Checks

@changeset-bot
Copy link

changeset-bot bot commented Mar 20, 2026

🦋 Changeset detected

Latest commit: 54bb24f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@digdir/designsystemet-web Patch
@digdir/designsystemet-react Patch
@digdir/designsystemet Patch
@digdir/designsystemet-css Patch
@digdir/designsystemet-types Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@TomasEng TomasEng force-pushed the fix-name-and-description-on-fieldset branch from 8b5fbf2 to 54bb24f Compare March 20, 2026 12:03
@TomasEng TomasEng changed the title fix(Fieldset): Apply name and description correctly fix(fieldset): Apply name and description correctly Mar 20, 2026
@TomasEng TomasEng changed the title fix(fieldset): Apply name and description correctly Fix(fieldset): Apply name and description correctly Mar 20, 2026
@TomasEng TomasEng changed the title Fix(fieldset): Apply name and description correctly fix(fieldset): Apply name and description correctly. Mar 20, 2026
@TomasEng TomasEng changed the title fix(fieldset): Apply name and description correctly. fix(FIELDSET): Apply name and description correctly Mar 20, 2026
@TomasEng TomasEng changed the title fix(FIELDSET): Apply name and description correctly fix(field set): Apply name and description correctly Mar 20, 2026
@TomasEng TomasEng changed the title fix(field set): Apply name and description correctly fix: Apply name and description correctly Mar 20, 2026
@TomasEng TomasEng changed the title fix: Apply name and description correctly FIX: Apply name and description correctly Mar 20, 2026
@TomasEng TomasEng changed the title FIX: Apply name and description correctly fix(Apply name and description correctly) Mar 20, 2026
@TomasEng TomasEng changed the title fix(Apply name and description correctly) fix(apply name and description correctly) Mar 20, 2026
@TomasEng TomasEng changed the title fix(apply name and description correctly) fix: APPLY NAME AND DESCRIPTION CORRECTLY Mar 20, 2026
@TomasEng TomasEng changed the title fix: APPLY NAME AND DESCRIPTION CORRECTLY FIX: APPLY NAME AND DESCRIPTION CORRECTLY Mar 20, 2026
@TomasEng TomasEng changed the title FIX: APPLY NAME AND DESCRIPTION CORRECTLY fix Mar 20, 2026
@TomasEng TomasEng changed the title fix FIX Mar 20, 2026
@TomasEng TomasEng changed the title FIX fix(fieldset) Mar 20, 2026
@TomasEng TomasEng changed the title fix(fieldset) fix(Fieldset) Mar 20, 2026
@TomasEng TomasEng changed the title fix(Fieldset) fix(Fieldset):Apply name and description correctly Mar 20, 2026
@TomasEng TomasEng changed the title fix(Fieldset):Apply name and description correctly fix(<Fieldset>): Apply name and description correctly Mar 20, 2026
@TomasEng TomasEng changed the title fix(<Fieldset>): Apply name and description correctly fix(field): Apply name and description correctly Mar 20, 2026
@TomasEng TomasEng changed the title fix(field): Apply name and description correctly fix(ds-field): Apply name and description correctly Mar 20, 2026
@TomasEng TomasEng changed the title fix(ds-field): Apply name and description correctly fix(web): Apply name and description correctly Mar 20, 2026
@TomasEng TomasEng changed the title fix(web): Apply name and description correctly fix(react): Apply name and description correctly Mar 20, 2026
@TomasEng TomasEng changed the title fix(react): Apply name and description correctly fix(web): Fieldset Mar 20, 2026
@TomasEng TomasEng changed the title fix(web): Fieldset fix(web):Fieldset Mar 20, 2026
@TomasEng TomasEng changed the title fix(web):Fieldset fix(web):fieldset Mar 20, 2026
@TomasEng TomasEng changed the title fix(web):fieldset fix(react):fieldset Mar 20, 2026
@TomasEng TomasEng changed the title fix(react):fieldset fix(react): fieldset Mar 20, 2026
@TomasEng TomasEng changed the title fix(react): fieldset fix(react): Fieldset Mar 20, 2026
@TomasEng TomasEng changed the title fix(react): Fieldset fix(react): <Fieldset> Mar 20, 2026
@TomasEng TomasEng changed the title fix(react): <Fieldset> fix(Fieldset): Apply name and description correctly Mar 20, 2026
@TomasEng TomasEng marked this pull request as ready for review March 20, 2026 13:44
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

Successfully merging this pull request may close these issues.

1 participant