Skip to content

Commit

Permalink
Allow column.editable: false to disable editing even if we have a cus…
Browse files Browse the repository at this point in the history
…tom editor
  • Loading branch information
nstepien committed Apr 22, 2020
1 parent 5d906bd commit bf2e479
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/columnUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ function clampColumnWidth<R, SR>(
// Logic extented to allow for functions to be passed down in column.editable
// this allows us to decide whether we can be editing from a cell level
export function canEdit<R, SR>(column: CalculatedColumn<R, SR>, row: R): boolean {
if (column.editable === false) return false;
if (typeof column.editable === 'function') {
return column.editable(row);
}
return Boolean(column.editor || column.editable);
return column.editor != null;
}

export function getColumnScrollPosition<R, SR>(columns: readonly CalculatedColumn<R, SR>[], idx: number, currentScrollLeft: number, currentClientWidth: number): number {
Expand Down

0 comments on commit bf2e479

Please sign in to comment.