浏览代码

Don't submit edit request if the value didn't change

Fela Maslen 7 年之前
父节点
当前提交
082f27b849
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/components/CrudField/index.js

+ 3 - 1
src/components/CrudField/index.js

@@ -39,7 +39,9 @@ export default class CrudField extends Component {
     };
 
     onEditEnd = () => {
-        this.props.onEditEnd(this.props.field, this.state.editValue);
+        if (this.state.editValue !== this.props.value) {
+            this.props.onEditEnd(this.props.field, this.state.editValue);
+        }
 
         this.setState({
             editing: false