|
@@ -153,7 +153,7 @@ class InputComp extends Component{
|
|
// FF26 只有innerHTML
|
|
// FF26 只有innerHTML
|
|
const text = e.target.innerText || e.target.innerHTML;
|
|
const text = e.target.innerText || e.target.innerHTML;
|
|
const {handleBlur,index} = this.props;
|
|
const {handleBlur,index} = this.props;
|
|
- e.target.innerHTML = '';
|
|
|
|
|
|
+ // e.target.innerHTML = '';
|
|
// FF26 会把 也获取到
|
|
// FF26 会把 也获取到
|
|
handleBlur(index,text.replace(' ',''));
|
|
handleBlur(index,text.replace(' ',''));
|
|
}
|
|
}
|
|
@@ -191,15 +191,20 @@ class InputComp extends Component{
|
|
}
|
|
}
|
|
this.over=false;
|
|
this.over=false;
|
|
}
|
|
}
|
|
- componentWillReceiveProps(next){
|
|
|
|
- //超过限制时,再点开下拉被删除的输入文字又出现bug修改
|
|
|
|
- const inp = this.$inp.current;
|
|
|
|
- const value = next.value;
|
|
|
|
- inp.innerHTML = '';
|
|
|
|
- setTimeout(function(){
|
|
|
|
- inp.innerHTML = value;
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ componentDidMount(){
|
|
|
|
+ const {value} = this.props;
|
|
|
|
+ const inp = this.$inp.current;
|
|
|
|
+ inp.innerHTML = value
|
|
|
|
+ }
|
|
|
|
+ // componentWillReceiveProps(next){
|
|
|
|
+ // //超过限制时,再点开下拉被删除的输入文字又出现bug修改
|
|
|
|
+ // const inp = this.$inp.current;
|
|
|
|
+ // const value = next.value;
|
|
|
|
+ // inp.innerHTML = '';
|
|
|
|
+ // setTimeout(function(){
|
|
|
|
+ // inp.innerHTML = value;
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
render(){
|
|
render(){
|
|
const {value} = this.props;
|
|
const {value} = this.props;
|
|
return <span contentEditable={true}
|
|
return <span contentEditable={true}
|