Autodesk / Autodesk/hig

Ensure all components can accept an `id` attribute

Open
#2,308 0 comments 0 reactions 1 assignee Claimed by @DevFoncy View on GitHub
Dominant language
JavaScript
Stars
193
Forks
112
PR merge metrics
No merged PRs in 30d

Description

We've noticed that we're not able to set an `id` on some HIG elements, such as `` ("@hig/accordion": "^1.1.1",), so we've been wrapping these as follows:

```jsx
export default function AccordionWrapper({ id, label, children, className = undefined }) {
// span is because HIG's accordion doesn't support setting an ID
return
storeInvertedCollapsed(id)} className={className || ''}>
{children}

;
}
```

# To be done
1. review the existing components' application of `id` attributes
1. form a list of elements that do not permit the `id` attribute to be set
1. apply the existing pattern found in pt 1 above to the items in pt 2
1. apply unit tests as appropriate

cc: @wmui51, re: [slack converstion](https://autodesk.slack.com/archives/C5FLF7R46/p1600852054008700) about this issue

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.