Files
Koen Kamman 282a98f046 fix(field): add explicit undefined to optional type annotation (#1422)
Update type annotation to be compatible with TypeScript's exactOptionalPropertyTypes option.
2026-06-08 11:49:05 +02:00
..

@spartan-ng/helm/field

Secondary entry point of @spartan-ng/helm. It can be used by importing from @spartan-ng/helm/field.

Accessibility helpers

The field package now exposes helpers to automatically wire aria-describedby from hlm-field-description and hlm-field-error instances. The BrnField directive provides the BrnFieldA11yService, hlm-field-description/hlm-field-error register unique IDs, and the brnFieldControlDescribedBy directive merges those IDs onto focusable controls. To support a new Helm control:

  1. Render the control inside an hlmField container.
  2. Apply brnFieldControlDescribedBy on the focusable native element (or host directive for standalone input-like directives).
  3. Let the description and error elements remain siblings inside the field; their IDs are generated automatically if you don't provide one.
  4. If you need to expose a custom aria-describedby, the directive will merge it with the field-generated IDs.