|
@@ -54,14 +54,14 @@ class NumberDrop extends Component{
|
|
}else{
|
|
}else{
|
|
//console.log(text,isNaN(+text),max<+text)
|
|
//console.log(text,isNaN(+text),max<+text)
|
|
if(needCompare){
|
|
if(needCompare){
|
|
- if(!isNaN(+text)&&max<+text){ //数值过大
|
|
|
|
|
|
+ if(text!=''&&!isNaN(+text)&&max<+text){ //数值过大
|
|
this.beyondArea();
|
|
this.beyondArea();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
const that = this;
|
|
const that = this;
|
|
timer = setTimeout(function(){
|
|
timer = setTimeout(function(){
|
|
clearTimeout(that.state.sltTimer);
|
|
clearTimeout(that.state.sltTimer);
|
|
- if(!that.props.show&&!isNaN(+text)&&min>+text){
|
|
|
|
|
|
+ if(text!=''&&!isNaN(+text)&&min>+text){
|
|
that.beyondArea();
|
|
that.beyondArea();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -140,7 +140,7 @@ class NumberDrop extends Component{
|
|
}
|
|
}
|
|
//输入超出合理范围提示且清空
|
|
//输入超出合理范围提示且清空
|
|
const txt = e.target.innerText.replace(/^\s*/,'');
|
|
const txt = e.target.innerText.replace(/^\s*/,'');
|
|
- if(max!=undefined&&!isNaN(+txt)&&(min>+txt||max<+txt)){
|
|
|
|
|
|
+ if(max!=undefined&&txt!=''&&!isNaN(+txt)&&(min>+txt||max<+txt)){
|
|
this.beyondArea();
|
|
this.beyondArea();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -151,21 +151,15 @@ class NumberDrop extends Component{
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- /*this.setState({
|
|
|
|
- hasSelect:false
|
|
|
|
- });*/
|
|
|
|
const val = e.target.innerText.replace(/^\s*/,'');
|
|
const val = e.target.innerText.replace(/^\s*/,'');
|
|
const {placeholder} = this.state;
|
|
const {placeholder} = this.state;
|
|
let text = val===placeholder?'':val.replace(/[\u4e00-\u9fa5]/g,'');
|
|
let text = val===placeholder?'':val.replace(/[\u4e00-\u9fa5]/g,'');
|
|
- e.target.innerText = ''; //避免出现重复输入值
|
|
|
|
|
|
+ //e.target.innerText = ''; //避免出现重复输入值
|
|
handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
|
|
handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
|
|
}
|
|
}
|
|
handleSpanInp(e){ //数字框输入事件
|
|
handleSpanInp(e){ //数字框输入事件
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
const {handleHide} = this.props;
|
|
const {handleHide} = this.props;
|
|
- /*this.setState({ //再键盘点击数字要清空
|
|
|
|
- hasSelect:false
|
|
|
|
- });*/
|
|
|
|
handleHide&&handleHide();
|
|
handleHide&&handleHide();
|
|
}
|
|
}
|
|
handleKeyDowm(e){
|
|
handleKeyDowm(e){
|