design-system icon indicating copy to clipboard operation
design-system copied to clipboard

Fieldsets: Legend element is outside the fieldset

Open contolini opened this issue 1 year ago • 2 comments

Our recommended fieldset pattern involves a <legend> element outside the <fieldset> element. This is invalid, the legend needs to be a child of the fieldset.

See https://validator.w3.org/nu/?doc=https%3A%2F%2Fcfpb.github.io%2Fdesign-system%2Fcomponents%2Ffieldsets

image

contolini avatar Apr 24 '24 14:04 contolini

We should fix this. There may be consequences to this depending on whether we depend on the current <legend> structure. I'll add it to our internal backlog.

sonnakim avatar Jun 27 '24 18:06 sonnakim

This needs investigation to see if we are depending in some way on this broken pattern, and if we are, refactoring so that the pattern is both accessible and works as intended. @anselmbradford will look at this next sprint

sonnakim avatar Jul 10 '24 15:07 sonnakim

PR --> https://github.com/cfpb/design-system/pull/2009

anselmbradford avatar Sep 11 '24 13:09 anselmbradford