Skip to content

Add inline cell editing#827

Open
lukasbash7 wants to merge 3 commits into
icflorescu:nextfrom
lukasbash7:feat/editable-cells
Open

Add inline cell editing#827
lukasbash7 wants to merge 3 commits into
icflorescu:nextfrom
lukasbash7:feat/editable-cells

Conversation

@lukasbash7

Copy link
Copy Markdown

What this adds

Inline cell editing triggered by double-click, with a plain unstyled <input> as the built-in fallback and full support for custom edit controls via editRender.

Per-column options

Prop Type Description
editable boolean | (record, index) => boolean Makes cells in the column editable
editRender (record, index, context) => ReactNode Custom edit control (replaces the built-in input)
commitEditOn ('blur' | 'enter')[] When to commit (default: both)

Table-level options

Prop Type Description
onCellEdit ({ record, index, accessor, value }) => void Callback fired on commit
defaultCommitEditOn ('blur' | 'enter')[] Default commit trigger for all columns
editMode 'cell' | 'global' 'cell': double-click one cell at a time (default); 'global': all editable cells in edit state simultaneously
editingCellStyle MantineStyleProp Style applied to the focused cell's <td>
editingCellClassName string Class name applied to the focused cell's <td>

Behaviour

  • Double-click a cell to enter edit mode (cell mode) or toggle via editMode prop (global mode)
  • Press Enter or click away to commit; Escape to cancel
  • Tab / Shift+Tab navigate between editable cells in global mode, wrapping across rows
  • All existing callbacks (onCellClick, onCellDoubleClick, onCellContextMenu, etc.) continue to fire normally
  • editRender receives { value, onChange, onCommit, onCancel }onCommit(value) lets controls like Select commit in a single event

Examples

Four examples added to /examples/editing-cells:

  1. Basic editable columns
  2. Per-cell editability using the editable predicate
  3. onCellEdit callback with a visible commit log showing the payload shape
  4. Custom editRender with a Mantine Select
  5. Global edit mode with focused-cell highlight and Tab/Shift+Tab navigation

icflorescu and others added 3 commits June 19, 2026 13:02
Mark any column as editable and provide an onCellEdit handler to enable
double-click inline editing. A plain unstyled <input> is used as the
built-in fallback; columns can supply an editRender function to render any
custom control (e.g. a Select dropdown).

Per-column options:
- editable: true | (record, index) => boolean
- editRender: (record, index, context) => ReactNode
- commitEditOn: ('blur' | 'enter')[]  (default: both)

Table-level options:
- onCellEdit: ({ record, index, accessor, value }) => void
- defaultCommitEditOn: ('blur' | 'enter')[]
- editMode: 'cell' (default) | 'global'
- editingCellStyle / editingCellClassName: style the focused cell's <td>

In global mode all editable cells are in edit state at once; Tab /
Shift+Tab navigate between them. Existing callbacks continue to fire.
Four examples on /examples/editing-cells:

- Basic editable columns with onCellEdit updating local state
- Per-cell editability using the editable predicate function
- onCellEdit callback with a visible commit log showing the payload shape
- Custom editRender with a Mantine Select (single-event commit via onCommit)
- Global edit mode (editMode="global") with Tab/Shift-Tab cell navigation
  and focused-cell highlight via editingCellStyle
@codesandbox

codesandbox Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@lukasbash7

Copy link
Copy Markdown
Author

@icflorescu I tried to generalize #767 with this PR and allow the users to define their own rendering behavior so the table does not have to deal too much with specifics. Would be great if you could take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants