Skip to content

Commit

Permalink
chore: isRowDisabled
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanVor committed Jan 18, 2024
1 parent dc062af commit 8e3718f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,15 @@ export function withTableActions<I extends TableDataItem, E extends {} = {}>(
}

private renderBodyCell = (item: I, index: number) => {
const {isRowDisabled, getRowActions, rowActionsSize} = this.props;
const {isRowDisabled, getRowActions, rowActionsSize, getRowDescriptor} = this.props;
const actions = getRowActions(item, index);

if (actions.length === 0) {
return null;
}

const disabled = isRowDisabled ? isRowDisabled(item, index) : false;
const disabled =
getRowDescriptor?.(item, index).disabled || isRowDisabled?.(item, index) || false;

return (
<div className={b('actions')}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,13 @@ export function withTableSelection<I extends TableDataItem, E extends {} = {}>(
);

private isDisabled = (item: I, index: number) => {
const {isRowDisabled, isRowSelectionDisabled} = this.props;
const {isRowDisabled, isRowSelectionDisabled, getRowDescriptor} = this.props;
if (isRowSelectionDisabled && isRowSelectionDisabled(item, index)) {
return true;
}
return isRowDisabled ? isRowDisabled(item, index) : false;
return (
getRowDescriptor?.(item, index).disabled || isRowDisabled?.(item, index) || false
);
};
};
}

0 comments on commit 8e3718f

Please sign in to comment.