You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Legend element represents a caption for fieldset as a label element represents a caption for form control elements (such as an input).
Therefore using a label inside a legend is unnecessary.
Also, the label inside legend uses a for attribute to associate it with the div element surrounding the fieldset. This doesn't match the HTML specs for the label element as the for attribute's value must be the ID of a labelable element (i.e. form control element, such as an input, NOT a div element).
The text was updated successfully, but these errors were encountered:
@riitasointi this continues to be an issue and should be fixed when convenient, even though it does not seem to cause actual issues with AT. It is confusing for consumers of the DS/component library and might be used as an example elsewhere.
The HTML structure for fieldsets is incorrect.
E.g. https://vrk-kpa.github.io/suomifi-design-system/components/radiobutton/
It uses a structure:
Legend element represents a caption for fieldset as a label element represents a caption for form control elements (such as an input).
Therefore using a label inside a legend is unnecessary.
Also, the label inside legend uses a for attribute to associate it with the div element surrounding the fieldset. This doesn't match the HTML specs for the label element as the for attribute's value must be the ID of a labelable element (i.e. form control element, such as an input, NOT a div element).
The text was updated successfully, but these errors were encountered: