diff --git a/src/Cell.tsx b/src/Cell.tsx index d0a26f28bd..cb04228a69 100644 --- a/src/Cell.tsx +++ b/src/Cell.tsx @@ -2,7 +2,7 @@ import { memo } from 'react'; import { css } from '@linaria/core'; import { useRovingTabIndex } from './hooks'; -import { createCellEvent, getCellClassname, getCellStyle, isCellEditable } from './utils'; +import { createCellEvent, getCellClassname, getCellStyle, isCellEditableUtil } from './utils'; import type { CellRendererProps } from './types'; const cellCopied = css` @@ -51,7 +51,7 @@ function Cell({ }, typeof cellClass === 'function' ? cellClass(row) : cellClass ); - const isEditable = isCellEditable(column, row); + const isEditable = isCellEditableUtil(column, row); function selectCellWrapper(openEditor?: boolean) { selectCell({ rowIdx, idx: column.idx }, openEditor); diff --git a/src/utils/selectedCellUtils.ts b/src/utils/selectedCellUtils.ts index 956aabcef2..a3142da8ce 100644 --- a/src/utils/selectedCellUtils.ts +++ b/src/utils/selectedCellUtils.ts @@ -20,10 +20,11 @@ export function isSelectedCellEditable({ }: IsSelectedCellEditableOpts): boolean { const column = columns[selectedPosition.idx]; const row = rows[selectedPosition.rowIdx]; - return isCellEditable(column, row); + return isCellEditableUtil(column, row); } -export function isCellEditable(column: CalculatedColumn, row: R): boolean { +// https://github.com/vercel/next.js/issues/56480 +export function isCellEditableUtil(column: CalculatedColumn, row: R): boolean { return ( column.renderEditCell != null && (typeof column.editable === 'function' ? column.editable(row) : column.editable) !== false