-
Notifications
You must be signed in to change notification settings - Fork 144
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]: Table onRowClick
with a table cell with link
#458
Comments
event.stopPropagation() works as expected |
Hello, Please notice that our onRowClick API on the table is not recommended to use as a combination of clickable rows and clickable row elements results in a non-optimal user experience. Even if you can resolve the click handlers, the users might struggle to click the right thing. I would recommend you to re-evaluate the need for onRowClick and try other options such as making table rows selectable and offering an action on the selected row(s) in the header. Table API: https://cloudscape.design/components/table/?tabId=api |
Thanks @pan-kot, From user perspective, isn't easier to just click on table row (an row item itself) and trigger the selection (to open the split panel) than finding the radio button (first column) to click on ? I believe that is the approach used on several aws console tables. Thanks! |
It could be that for some experiences clicking on the row is easier. However, if, say, there are more clickable targets like links, or maybe you decide to make cell data editable inline - the clickable rows are no longer that great. As a design system we try to come up with patterns that are consistent and reusable. It is true that some consoles might not yet have a chance to adopt those so the recommended approach here is to follow our guidance and demos. Surely there is more than one way to make the users happy so if something works for you - that's great. We are happy to learn from your stories and improve! |
Browser
No response
Package version
^3.0.95
React version
^17.0.2
Description
Hi 👋 ,
I have a
Table
component with anonRowClick
. The table has a cell that renders aLink
component with anonFollow
handler attached to it.I need to trigger
onRowClick
only when user clicked on the cell, or outside cell, but it should NOT trigger when user clicked on theLink
event.preventDefault()
from theonFollow
does not help much.Is that even possible ? (to have onFollow event to cancel onRowClick)
Thanks
Source code
No response
Reproduction
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: