Skip to content

Commit

Permalink
Clear cell contents when single cell is selected but not editing (#396)
Browse files Browse the repository at this point in the history
Co-authored-by: Jarom Madsen <jarom@decisely.com>
  • Loading branch information
jarommadsen and Jarom Madsen committed Jun 2, 2024
1 parent 32b6e15 commit 4e553b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ export default function reducer(
return state;
}
if (state.mode === "view" && state.active) {
const selectedRange = state.selected.toRange(state.model.data);
if (selectedRange?.size() === 1) {
return edit(clear(state));
}
return edit(state);
}
return state;
Expand Down

0 comments on commit 4e553b5

Please sign in to comment.