Pass ref to a TableExpandRow component on React #9443
Labels
adopter: product
Work-stream that directly helps a Product team.
component: data-table
package: @carbon/react
@carbon/react
proposal: accepted
This request has gone through triaging and we are accepting PR's against it.
type: enhancement 💡
Summary
Please describe your request in one or two sentences.
I am using
carbon-components-react
. I want to be able to pass a ref to theTableExpandRow
component so I can use thescrollIntoView
function on a particular row.Clarify if you are asking for design, development, or both design and
development.
development
Justification
In my case, I have a line chart and a table bellow. Each x-label corresponds to a particular row. I want to let the user press a label and to be redirected to the corresponding table row. For that, I should be able to obtain a reference to the
tr
tag insideTableExpandRow
."Must have" functionality
As
TableExpandRow
is implemented a functional component, a ref can't be pass as a prop unless React.forwardRed is used.Available extra resources
This issue is similar to #8744.
Also, note that what is suggested here can't be done. Wrapping
TableExpandRow
inside adiv
would break a several carbon css selectors.The text was updated successfully, but these errors were encountered: