File tree Expand file tree Collapse file tree
src/components/SelectionList
SelectionListWithSections Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -347,8 +347,8 @@ function BaseSelectionList<TItem extends ListItem>({
347347 } ;
348348
349349 const renderItem : ListRenderItem < TItem > = ( { item, index} : ListRenderItemInfo < TItem > ) => {
350- const isItemDisabled = isDisabled || item . isDisabled ;
351350 const selected = isItemSelected ( item ) ;
351+ const isItemDisabled = isDisabled || ( ! ! item . isDisabled && ! selected ) ;
352352 const isItemFocused = ( ! isDisabled || selected ) && focusedIndex === index ;
353353 const isItemVisuallyFocused = isItemFocused && ( shouldHighlightInitiallyFocusedItem || isKeyboardNavigating ) ;
354354 const isItemHighlighted = ! ! itemsToHighlight ?. has ( item . keyForList ) ;
Original file line number Diff line number Diff line change @@ -25,8 +25,6 @@ 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 ;
3028
3129 return (
3230 < BaseListItem
@@ -43,8 +41,8 @@ function SelectableListItem<TItem extends ListItem>({
4341 < ButtonComponent
4442 item = { item }
4543 onSelectRow = { onSelectionButtonPress ?? onSelectRow }
46- disabled = { isButtonDisabled }
47- style = { [ styles . ml3 , shouldDimButton && styles . buttonOpacityDisabled ] }
44+ disabled = { ! ! isDisabled || ! ! item . isDisabledCheckbox }
45+ style = { styles . ml3 }
4846 />
4947 { typeof rightHandSideComponent === 'function' ? rightHandSideComponent ( item , isFocused ) : rightHandSideComponent }
5048 </ >
@@ -59,8 +57,8 @@ function SelectableListItem<TItem extends ListItem>({
5957 < ButtonComponent
6058 item = { item }
6159 onSelectRow = { onSelectionButtonPress ?? onSelectRow }
62- disabled = { isButtonDisabled }
63- style = { [ styles . mr3 , shouldDimButton && styles . buttonOpacityDisabled ] }
60+ disabled = { ! ! isDisabled || item . isDisabledCheckbox }
61+ style = { styles . mr3 }
6462 />
6563 { typeof children === 'function' ? children ( hovered ) : children }
6664 </ >
Original file line number Diff line number Diff line change @@ -364,7 +364,7 @@ function BaseSelectionListWithSections<TItem extends ListItem>({
364364 case CONST . SECTION_LIST_ITEM_TYPE . ROW : {
365365 const isItemFocused = index === focusedIndex ;
366366 const isItemVisuallyFocused = isItemFocused && ( shouldHighlightInitiallyFocusedItem || isKeyboardNavigating ) ;
367- const isDisabled = ! ! item . isDisabled ;
367+ const isDisabled = ! ! item . isDisabled && ! item . isSelected ;
368368
369369 return (
370370 < ListItemRenderer
You can’t perform that action at this time.
0 commit comments