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

[Bug]: getRowProps onClick properties do not work #18173

Open
2 tasks done
adamalston opened this issue Nov 28, 2024 · 0 comments
Open
2 tasks done

[Bug]: getRowProps onClick properties do not work #18173

adamalston opened this issue Nov 28, 2024 · 0 comments

Comments

@adamalston
Copy link
Contributor

Package

@carbon/react

Browser

No response

Package version

1.67.1

React version

No response

Description

getRowProps onClick properties do not work.

What's the purpose of the onClick in getRowProps? Was it mistakenly added as a property in the object, or does functionality need to be added to call it when the row is clicked?

Reproduction/example

https://stackblitz.com/edit/github-mpxygv?file=src%2FApp.tsx

Steps to reproduce

Click a row in the table in the reproduction and see that nothing happens.

If this change is made in the code in the reproduction, the onClick works.

   <TableRow
+    onClick={() => window.open(`/${row.id}`, '_blank')}
     {...getRowProps({
       row,
-      onClick: () => window.open(`/${row.id}`, '_blank'),
     })}
   >
     {row.cells.map((cell) => (

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Application/PAL

DataPower

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ⏱ Backlog
Development

No branches or pull requests

3 participants