Skip to content

[Textbox] Label not associated with input via htmlFor #54

@olegpolyakov

Description

@olegpolyakov

Component

Textbox

Problem

Label element is not associated with the input control via htmlFor.

Suggested Fix

const id = useId();

<label htmlFor={id} className={styles.label}>
    {label}
</label>

// Pass id to control via children

Impact

Clicking label doesn't focus input

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions