backpex
backpex copied to clipboard
Use `label` element on form views
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