The emitted code adds an attribute aria-labelledby=“label-58653a” but this ID doesn’t exist because there’s no common field label with that ID, just labels for the options without an ID attribute.
For other field types, with “Show Labels” disabled, like Text field, there’s no aria-labelledby attribute. That should be handled the same for Checkbox fields.
Better have no aria-labelledby attribute than an invalid one.
That’s a minor drawback. We’ll see if we can improve that. Theoretically, we could always output the aria-label, provided that a value (label) is available. If “show labels” is enabled, we switch to “aria-labelledby”. In my opinion, that would be the most sensible solution, or am I overlooking something?
Exactly. You should only emit the aria-labelledby if the referenced label is really available.
For other fields that seems to be the correct behavior, but for Checkbox, it’s currently not:
The aria-labelledby is always emitted no matter if the label is shown or not.