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

[data-table]: radio buttons should not include check all option and selecting individual rows does not trigger toolbar #17850

Open
2 tasks done
kennylam opened this issue Mar 25, 2024 · 2 comments · May be fixed by carbon-design-system/carbon-for-ibm-dotcom#11685
Assignees
Labels
package: @carbon/web-components @carbon/web-components

Comments

@kennylam
Copy link
Member

Description

When radio buttons are used, the check all option should not be available as only one per group is selectable. Additionally, selecting radio buttons does not activate the table toolbar.

image (1)

image (2)

Component(s) impacted

data-table

Browser

Chrome, Safari, Firefox, Microsoft Edge

Carbon for IBM.com version

v2.5.0

Severity

Severity 2 = Aspects of design is broken, and impedes users in a significant way, but there is a way to complete their tasks. Affects major functionality, has a workaround.

Application/website

@carbon/web-components

Package

@carbon/web-components

CodeSandbox example

https://web-components.carbondesignsystem.com/?path=/story/components-datatable-selection--with-radio-selection

Steps to reproduce the issue (if applicable)

No response

Release date (if applicable)

No response

Code of Conduct

@sangeethababu9223
Copy link
Member

Table toolbar is needed only when we are choosing multiple rows and with radio button we can only choose one row at a time, hence the batch action toolbar is not needed here. The same behaviour can be seen in the carbon/react data table also with radio button option.

The select all option is now being hidden with hide-checkbox attribute added manually to the element in storybook, this can be updated if needed.

@dave-wood
Copy link

I've just had this same problem again (I think Kenny created this issue based on what I reported on the slack channel) and I think this still needs more work.

With regards to the above comment, firstly, yes you can add hide-checkbox to the table header row to prevent the "bug" of it allowing multiple radio buttons to be checked - but that is a workaround not a fix, you shouldn't need the user to do that. By default the select all checkbox should NOT appear if you are using the radio button option here.

Secondly, I disagree that the batch action buttons are not required if you are only selecting 1 item in the table. I need this feature all the time. I have a table of items, I want the user to select the radio button for a row and an action button should then appear allowing the user to Edit or Delete the item. Yes, a single item.

Because the batch action buttons don't appear when you use radio buttons, then I'm going to be forced to use checkboxes, and code the extra check to make sure the user has only checked 1 row. Surely it's not too much to ask to have the batch action buttons appear with radio! It would make my life easier.

These 2 items have been outstanding for months now - would it be possible to get this looked at? Thanks.

@kennylam kennylam transferred this issue from carbon-design-system/carbon-for-ibm-dotcom Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: @carbon/web-components @carbon/web-components
Projects
Status: ⏱ Backlog
Development

Successfully merging a pull request may close this issue.

3 participants