|
@@ -41,6 +41,7 @@ class ItemBox extends Component {
|
|
|
|
|
|
componentDidMount(){
|
|
|
const {setRef} = this.props;
|
|
|
+ this.$div.current.innerHTML=''; //bug2276,FF26初始光标位置问题
|
|
|
setRef&&setRef(this.$div);
|
|
|
if(isIE()){
|
|
|
$(this.$div.current).onIe8Input(function(e){
|
|
@@ -56,13 +57,17 @@ componentWillReceiveProps(nextP){
|
|
|
that.context.scrollArea&&that.context.scrollArea.refresh();
|
|
|
});
|
|
|
}
|
|
|
+ //bug2276,FF26初始光标位置问题
|
|
|
+ if(!nextP.children&&!nextP.fuzhen){
|
|
|
+ this.$div.current.innerHTML='';
|
|
|
+ }
|
|
|
}
|
|
|
render(){
|
|
|
const {title,children,editable,className,handleFocus,fuzhen,border,handleBlur,titleTop,backgroundColor,boxId} = this.props;
|
|
|
return <div className={style["box"]+" "+"clearfix"} >
|
|
|
<div className={style["title"] + ' '+(className||'')} style={{marginTop:titleTop?'22px':''}}>{title}</div>
|
|
|
- <div ref={this.$div} className={`${style["content"]} ${border?style["border"]:''} ${backgroundColor?style["noBorder"]:''}`} contentEditable={editable} style={this.getBoxStyle()} onFocus={handleFocus} onInput={this.handleInput} onClick={(e)=>{this.handleClick(e);}} onBlur={handleBlur} id={boxId} onkeydown={handleEnter}>
|
|
|
- {fuzhen?children||fuzhen:children}
|
|
|
+ <div ref={this.$div} className={`${style["content"]} ${border?style["border"]:''} ${backgroundColor?style["noBorder"]:''}`} contentEditable={editable} style={this.getBoxStyle()} onFocus={editable?handleFocus:null} onInput={this.handleInput} onClick={(e)=>{this.handleClick(e);}} onBlur={handleBlur} id={boxId} onkeydown={handleEnter}>
|
|
|
+ {fuzhen?children||fuzhen||'':children||''}
|
|
|
</div>
|
|
|
</div>
|
|
|
}
|