diff --git a/lib/editor/components/timetable/EditableCell.js b/lib/editor/components/timetable/EditableCell.js index b9fc5766c..a96770d76 100644 --- a/lib/editor/components/timetable/EditableCell.js +++ b/lib/editor/components/timetable/EditableCell.js @@ -118,11 +118,11 @@ function EditableCell (props: Props) { offsetScrollCol, offsetScrollRow } = props - const {isEditing} = state + const {isEditing, data, originalData} = state switch (evt.keyCode) { case 13: // Enter evt.preventDefault() - if (isFocused) { + if (isFocused && isEditing && data !== originalData) { beginEditing() save() // handle shift @@ -135,7 +135,9 @@ function EditableCell (props: Props) { // save and advance to next cell if editing evt.preventDefault() evt.stopPropagation() - save() + if (isEditing && data !== originalData) { + save() + } offsetScrollCol(evt.shiftKey ? -1 : 1) break @@ -232,7 +234,10 @@ function EditableCell (props: Props) { } const handleBlur = () => { - save() + const {isEditing, data, originalData} = state + if (isEditing && data !== originalData) { + save() + } } const handleChange = (evt) => { @@ -302,7 +307,7 @@ function EditableCell (props: Props) { } const cellHtml = isEditing ?