File tree Expand file tree Collapse file tree
src/components/SelectionList/ListItem Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ function SelectableListItem<TItem extends ListItem>({
2525} : SelectableListItemProps < TItem > ) {
2626 const styles = useThemeStyles ( ) ;
2727 const ButtonComponent = canSelectMultiple ? ListCheckbox : ListRadioButton ;
28+ const isButtonDisabled = ( ! ! isDisabled && ! item . isSelected ) || item . isDisabledCheckbox ;
29+ const shouldDimButton = ! ! isDisabled && ! ! item . isSelected && ! item . isDisabledCheckbox ;
2830
2931 return (
3032 < BaseListItem
@@ -41,8 +43,8 @@ function SelectableListItem<TItem extends ListItem>({
4143 < ButtonComponent
4244 item = { item }
4345 onSelectRow = { onSelectionButtonPress ?? onSelectRow }
44- disabled = { ( ! ! isDisabled && ! item . isSelected ) || item . isDisabledCheckbox }
45- style = { styles . ml3 }
46+ disabled = { isButtonDisabled }
47+ style = { [ styles . ml3 , shouldDimButton && styles . buttonOpacityDisabled ] }
4648 />
4749 { typeof rightHandSideComponent === 'function' ? rightHandSideComponent ( item , isFocused ) : rightHandSideComponent }
4850 </ >
@@ -57,8 +59,8 @@ function SelectableListItem<TItem extends ListItem>({
5759 < ButtonComponent
5860 item = { item }
5961 onSelectRow = { onSelectionButtonPress ?? onSelectRow }
60- disabled = { ( ! ! isDisabled && ! item . isSelected ) || item . isDisabledCheckbox }
61- style = { styles . mr3 }
62+ disabled = { isButtonDisabled }
63+ style = { [ styles . mr3 , shouldDimButton && styles . buttonOpacityDisabled ] }
6264 />
6365 { typeof children === 'function' ? children ( hovered ) : children }
6466 </ >
You can’t perform that action at this time.
0 commit comments