|
@@ -248,6 +248,9 @@ class NumberDrop extends Component{
|
|
|
const cls = this.props.show?style['blued']:'';
|
|
|
return cls;
|
|
|
}
|
|
|
+ stopBubble(e){
|
|
|
+ e.stopPropagation();
|
|
|
+ }
|
|
|
componentDidMount(){
|
|
|
//设置最小宽度避免输入后宽度跳动
|
|
|
const spanWidth = window.getComputedStyle(this.$span.current).width;
|
|
@@ -262,12 +265,12 @@ class NumberDrop extends Component{
|
|
|
//console.log(prefix,value,placeholder+'1',this.props.placeholder)
|
|
|
return <div className={this.getClasses()}
|
|
|
ref={this.$cont}
|
|
|
- onDoubleClick={this.changeToEdit}
|
|
|
+ onDblClick ={this.changeToEdit}
|
|
|
onClick={allClick?this.handleNumClick:null}
|
|
|
contentEditable={editable}
|
|
|
onBlur={this.handleBlur}
|
|
|
onKeyDown={handleEnter}
|
|
|
- onFocus={(e)=>{e.stopPropagation()}}>
|
|
|
+ onFocus={this.stopBubble.bind(this)}>
|
|
|
<span ref = {this.$pre}> {prefix}</span>
|
|
|
<span onFocus={this.handleNumFocus}
|
|
|
onClick={allClick?null:this.handleNumClick}
|