iTwin / iTwinUI-react

A react component library for iTwinUI.
https://github.com/iTwin/iTwinUI
Other
84 stars 23 forks source link

Allow tables to disable selection for specific rows #472

Closed ChrisBAtBentley closed 2 years ago

ChrisBAtBentley commented 2 years ago

Feature

It would be nice to have the ability to disable only the checkbox in individual rows so that users can still use subcomponents but cannot select the given row. Currently, it's all or nothing with disabling rows.

Examples

When checkbox is disabled, selection does not work on it, but all other elements in the row should work.

bentleyvk commented 2 years ago

As a temporary workaround you can copy paste checkbox column code from here https://github.com/iTwin/iTwinUI-react/blob/main/src/core/Table/hooks/useSelectionCell.tsx#L19 and handle disabled state yourself.

bentleyvk commented 2 years ago

Hey @ChrisBAtBentley, it is finally ready in v1.36.0 🎉 Here is the example with all available combinations. If you need help, don't hesitate to ask!