Open owenatgov opened 1 year ago
We been looking into being able to add an id to a fieldset where the question heading is the same as the page heading. This is possible on raw html, but for nunjucks, the above attribute suggestion does not work currently.
It was requested by the testers in our team so they can target the h1's for regression testing.
I have tried the attributes feature on text input components where you only have a label and input, and it works great. But the attributes features does not work on legends.
Investigate the feasibility of adding a default
id
attribute for applying an optional HTML id to all component nunjucks macros. This would be similar toclass
andattributes
, the 2 current default attributes.Context
This has come up in conversation on support and in the following related issues:
The case for doing this in brief is that
id
is a standard part of the HTML spec, similar toclass
, so exposing it would be useful for teams who might need to use theid
attribute for any reason.Additionally, several components already feature an
id
attribute so making this consistent has value.Alternatives
Currently teams can do this via
attributes
: