backpex icon indicating copy to clipboard operation
backpex copied to clipboard

Use `label` element on form views

Open Flo0807 opened this issue 9 months ago • 0 comments

To improve a11y we should use the HTML label element for input labels and reference the input with the for attribute.

For this, we have to refactor the Backpex.HTML.Layout.input_label component to require a for attr. Every time we call the component, e.g. in fields, we then need to pass the id of the input (most of the time this would be @form[@name].id) to the input_label component.

For reference: There is a closed PR that already made most of these changes. https://github.com/naymspace/backpex/pull/731

Flo0807 avatar Apr 24 '25 14:04 Flo0807