Skip to content

Commit

Permalink
remove shouldPreventDisableCheckboxIfDisabled prop
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer committed Dec 9, 2024
1 parent 072684d commit 00f2fb2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/SelectionList/TableListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function TableListItem<TItem extends ListItem>({
accessibilityLabel={item.text ?? ''}
role={CONST.ROLE.BUTTON}
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
disabled={(isDisabled && !item.shouldPreventDisableCheckboxIfDisabled) || item.isDisabledCheckbox}
disabled={isDisabled || item.isDisabledCheckbox}
onPress={handleCheckboxPress}
style={[styles.cursorUnset, StyleUtils.getCheckboxPressableStyle(), item.isDisabledCheckbox && styles.cursorDisabled, styles.mr3, item.cursorStyle]}
>
Expand Down
3 changes: 0 additions & 3 deletions src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,6 @@ type ListItem = {

/** The style to override the default appearance */
itemStyle?: StyleProp<ViewStyle>;

/** Whether to prevent checkbox from being disabled */
shouldPreventDisableCheckboxIfDisabled?: boolean;
};

type TransactionListItemType = ListItem &
Expand Down
1 change: 0 additions & 1 deletion src/pages/workspace/WorkspaceMembersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson
isDisabledCheckbox: !(isPolicyAdmin && accountID !== policy?.ownerAccountID && accountID !== session?.accountID),
isDisabled: isPendingDeleteOrError,
isInteractive: !details.isOptimisticPersonalDetail,
shouldPreventDisableCheckboxIfDisabled: !isPendingDeleteOrError,
cursorStyle: details.isOptimisticPersonalDetail ? styles.cursorDefault : {},
text: formatPhoneNumber(PersonalDetailsUtils.getDisplayNameOrDefault(details)),
alternateText: formatPhoneNumber(details?.login ?? ''),
Expand Down

0 comments on commit 00f2fb2

Please sign in to comment.