Skip to content

[EuiFormRow] API and a11y cleanup #2493

@myasonik

Description

@myasonik

Proposal

Deprecate labelType and hasChildLabel on <EuiFormRow> and, instead, programmatically detect what the correct element should be.

Our current solution requires the developer to know ahead of time what's going to render and how the child elements effect what you have to pass into EuiFormRow.

Details

In general, it should be <label> unless the child form elements already have an accessible name wired up.

So, elements that need a label: <input>, <meter>, <output>, <progress>, <select>, and <textarea>. (Technically, <button> supports having a <label> wired up but it doesn't work very well.)

And, elements can be labelled with a wired up <label>, aria-label, or aria-labelledby.

Extra adjacent fixes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions