|
@@ -37,6 +37,7 @@ class EditableSpan extends Component{
|
|
|
this.handleKeydown = this.handleKeydown.bind(this);
|
|
|
this.handleKeyup = this.handleKeyup.bind(this);
|
|
|
this.moveEnd = this.moveEnd.bind(this);
|
|
|
+ this.handleClick = this.handleClick.bind(this);
|
|
|
}
|
|
|
handleFocus(e){
|
|
|
e.stopPropagation();
|
|
@@ -279,6 +280,9 @@ class EditableSpan extends Component{
|
|
|
this.$span.current.innerText?(this.$span.current.innerText = next.value||''):(this.$span.current.innerHTML = next.value||'');
|
|
|
}
|
|
|
}
|
|
|
+ handleClick(e){
|
|
|
+ $(this.$span.current).attr({"contentEditable":true}).focus()
|
|
|
+ }
|
|
|
componentDidMount(){
|
|
|
const {value} = this.props;
|
|
|
const that = this;
|
|
@@ -302,7 +306,6 @@ class EditableSpan extends Component{
|
|
|
sel.removeAllRanges();
|
|
|
}
|
|
|
}*/
|
|
|
-
|
|
|
getClass(){
|
|
|
const {full,value,saveText,i} = this.props;
|
|
|
const preSelected = saveText[i-1];
|
|
@@ -320,6 +323,7 @@ class EditableSpan extends Component{
|
|
|
onFocus={this.handleFocus}
|
|
|
onBlur={this.handleBlur}
|
|
|
onkeydown={this.handleKeydown}
|
|
|
+ onclick={this.handleClick}
|
|
|
onkeyup={this.handleKeyup}></span>;
|
|
|
|
|
|
}
|