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