|
@@ -26,6 +26,7 @@ class MultSpread extends Component{
|
|
this.state = {
|
|
this.state = {
|
|
editable: false,
|
|
editable: false,
|
|
};
|
|
};
|
|
|
|
+ this.$cont = React.createRef();
|
|
this.changeToEdit = this.changeToEdit.bind(this);
|
|
this.changeToEdit = this.changeToEdit.bind(this);
|
|
this.handleEdit = this.handleEdit.bind(this);
|
|
this.handleEdit = this.handleEdit.bind(this);
|
|
}
|
|
}
|
|
@@ -103,7 +104,10 @@ class MultSpread extends Component{
|
|
this.setState({
|
|
this.setState({
|
|
editable: true
|
|
editable: true
|
|
});
|
|
});
|
|
- //e.target.focus();
|
|
|
|
|
|
+ //失焦关闭编辑状态
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.$cont.current.focus();
|
|
|
|
+ });
|
|
//双击埋点记录
|
|
//双击埋点记录
|
|
handleDbclick && handleDbclick({id:copyId});
|
|
handleDbclick && handleDbclick({id:copyId});
|
|
}
|
|
}
|
|
@@ -135,6 +139,7 @@ class MultSpread extends Component{
|
|
return (<div className={this.getContClass()}
|
|
return (<div className={this.getContClass()}
|
|
style={{display:'inline-block'}}
|
|
style={{display:'inline-block'}}
|
|
onDoubleClick={this.changeToEdit}
|
|
onDoubleClick={this.changeToEdit}
|
|
|
|
+ ref = {this.$cont}
|
|
contentEditable={this.state.editable}
|
|
contentEditable={this.state.editable}
|
|
onBlur={this.handleEdit}
|
|
onBlur={this.handleEdit}
|
|
onkeydown={tools.handleEnter}>
|
|
onkeydown={tools.handleEnter}>
|