carbon-addons-ics icon indicating copy to clipboard operation
carbon-addons-ics copied to clipboard

[Cardv2] forward ref to inner element so it can be focused

Open ZacharyStair opened this issue 6 years ago • 1 comments

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

  1. Step one
  2. Step two
  3. Step three
  4. 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.

ZacharyStair avatar Oct 26 '18 19:10 ZacharyStair

@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

ZacharyStair avatar Oct 30 '18 20:10 ZacharyStair