Browse Source

[BUG]分组管理不允许改组名为空

zhuth 6 years ago
parent
commit
bc10d1f3dd
1 changed files with 10 additions and 2 deletions
  1. 10 2
      src/components/common/groupManageMentBox/box.jsx

+ 10 - 2
src/components/common/groupManageMentBox/box.jsx

@@ -50,11 +50,17 @@ class GroupBox extends React.Component {
                                 this.setState({ editingKey: false });
                             }}/>}
                             onBlur={(e) => {
-                                this.modifyGroup({ ...t, label:e.target.value });
                                 this.setState({ editingKey: false });
-                            }} onPressEnter={(e) => {
+                                if(!e.target.value.trim()) {
+                                    return;
+                                }
                                 this.modifyGroup({ ...t, label:e.target.value });
+                            }} onPressEnter={(e) => {
                                 this.setState({ editingKey: false });
+                                if(!e.target.value.trim()) {
+                                    return;
+                                }
+                                this.modifyGroup({ ...t, label:e.target.value });
                             }}
                         />
                     </div> :
@@ -69,6 +75,8 @@ class GroupBox extends React.Component {
                         {t.code !== editingKey && <Icon type='edit' onClick={() => {
                             this.setState({
                                 editingKey: t.code
+                            }, () => {
+                                this['inputRef-' + t.code].focus();
                             });
                         }}/>}
                         {!t.children && <Icon type='delete' onClick={() => {