Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure all components can accept an id attribute #2308

Open
dylankenneally opened this issue Oct 1, 2020 · 0 comments
Open

Ensure all components can accept an id attribute #2308

dylankenneally opened this issue Oct 1, 2020 · 0 comments
Assignees

Comments

@dylankenneally
Copy link
Contributor

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

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

To be done

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

cc: @wmui51, re: slack converstion about this issue

@DevFoncy DevFoncy self-assigned this Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants