Skip to content

Accessible IDs are broken with latest version of Garden and React v17 #2057

@Fredx87

Description

@Fredx87

When using the latest version of Garden with React 17, accessible IDs have undefined instead of an incremental counter. For example, a label has a undefined--label id instead something like of id:0--label. This is a big problem since multiple components on the same page will have the same label.
I am not sure if this is happening for all components or only some of them, but this is a reproduction with comboboxes: https://codesandbox.io/p/sandbox/long-wave-7ktgt6?file=%2Fsrc%2Findex.tsx%3A9%2C53

The issue seems related specifically to version 2.0.3 of @zendeskgarden/container-utilities, and this change: https://github.com/zendeskgarden/react-containers/pull/701/files

When @reach/auto-id returns undefined, the useId function now returns the string undefined, while before it fell back to an autogenerated ID

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions