Skip to content

Commit 92fdf7d

Browse files
committed
Fix pasting
1 parent 967838b commit 92fdf7d

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## 4.10.3
4+
> Date: 2023-02-15
5+
### Fix
6+
- Fix paste issue when editing
7+
38
## 4.10.2
49
> Date: 2023-02-08
510
### Fix

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-datasheet-grid",
3-
"version": "4.10.2",
3+
"version": "4.10.3",
44
"description": "An Excel-like React component to create beautiful spreadsheets.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/components/DataSheetGrid.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ export const DataSheetGrid = React.memo(
857857

858858
const onPaste = useCallback(
859859
(event: ClipboardEvent) => {
860-
if (activeCell) {
860+
if (activeCell && !editing) {
861861
let pasteData = [['']]
862862
if (event.clipboardData?.types.includes('text/html')) {
863863
pasteData = parseTextHtmlData(
@@ -876,7 +876,7 @@ export const DataSheetGrid = React.memo(
876876
event.preventDefault()
877877
}
878878
},
879-
[activeCell, applyPasteDataToDatasheet]
879+
[activeCell, applyPasteDataToDatasheet, editing]
880880
)
881881

882882
useDocumentEventListener('paste', onPaste)

0 commit comments

Comments
 (0)