carbon-addons-ics
carbon-addons-ics copied to clipboard
[Cardv2] forward ref to inner element so it can be focused
Detailed description
Describe in detail the issue you're having. Is this a feature request (new component, new icon), a bug, or a general issue?
I'm implementing a grid of expandable cards (similar to the Orient Me homepage), and want to be able to easily reference each card's root element so I can focus them.
Is this issue related to a specific component?
Cardv2
What did you expect to happen? What happened instead? What would you like to see changed?
ref
is a special property in React, if you pass a ref
to a react component, React uses it internally instead of passing it as a prop to the component itself (much like key
in elements rendered in an array). ref
also acts differently when passed to a plain html element like a span
than when passed to a react component like Cardv2
: the latter happens to be mostly useless in this case, I'd like the ref to be passed through to the appropriate dom element that the card renders
What browser are you working in?
What version of the Carbon Design System and carbon-addons-ics are you using?
What offering/product do you work on? Any pressing ship or release dates we should be aware of?
Connections Community Catalog https://github.ibm.com/connections-incubator/connections-catalog-components
Steps to reproduce the issue
- Step one
- Step two
- Step three
- etc.
Additional information
- Screenshots or code
- Notes
Add labels
Please choose the appropriate label(s) from our existing label list to ensure that your issue is properly categorized. This will help us to better understand and address your issue.
@j1mie is this a reasonable thing to add? adding it as a higher-order component would allow the same functionality to be included in other components without much headache