|
@@ -95,21 +95,21 @@ class NumberDrop extends Component{
|
|
hasSelect:false
|
|
hasSelect:false
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- handleNumFocus(e){console.log('focus')
|
|
|
|
|
|
+ handleNumFocus(e){
|
|
const {placeholder} = this.state;
|
|
const {placeholder} = this.state;
|
|
- const val = e.target.innerText.trim();//console.log(33,e.target.innerText,placeholder,e.target.innerText.trim() == placeholder)
|
|
|
|
|
|
+ const val = this.$span.current.innerText.trim();//console.log(33,e.target.innerText,placeholder,e.target.innerText.trim() == placeholder)
|
|
if(val!=''&&val == placeholder){
|
|
if(val!=''&&val == placeholder){
|
|
this.setState({
|
|
this.setState({
|
|
placeholder:''
|
|
placeholder:''
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- e.stopPropagation();
|
|
|
|
|
|
+ e&&e.stopPropagation();
|
|
const {show,handleShow,ikey,id,patId,handleHide} = this.props;
|
|
const {show,handleShow,ikey,id,patId,handleHide} = this.props;
|
|
if(show) {
|
|
if(show) {
|
|
handleHide && handleHide();
|
|
handleHide && handleHide();
|
|
return;
|
|
return;
|
|
}else{
|
|
}else{
|
|
- this.$span.current.focus();
|
|
|
|
|
|
+ //this.$span.current.focus();
|
|
this.setState({
|
|
this.setState({
|
|
hasSelect:false,
|
|
hasSelect:false,
|
|
placeholder:'' //火狐26placeholder点击不隐藏bug修改
|
|
placeholder:'' //火狐26placeholder点击不隐藏bug修改
|
|
@@ -125,8 +125,10 @@ class NumberDrop extends Component{
|
|
handleHide && handleHide();
|
|
handleHide && handleHide();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- handleNumClick(e){ //数字框不可编辑的状态时点击事件,点击将数字框变为可输入且下拉不再显示直到失焦后再次聚集
|
|
|
|
|
|
+ handleNumClick(e){ //数字框不可编辑的状态时点击事件,点击将数字框变为可输入且下拉不再显示直到失焦后再次聚集
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
|
|
+ this.$span.current.focus();
|
|
|
|
+ //this.handleNumFocus();
|
|
/*const {show,handleShow,ikey,id,patId,handleHide} = this.props;
|
|
/*const {show,handleShow,ikey,id,patId,handleHide} = this.props;
|
|
if(show) {
|
|
if(show) {
|
|
handleHide && handleHide();
|
|
handleHide && handleHide();
|
|
@@ -270,12 +272,12 @@ class NumberDrop extends Component{
|
|
const {placeholder,hasSelect} = this.state;
|
|
const {placeholder,hasSelect} = this.state;
|
|
return <div className={this.getClasses(nospecial)}
|
|
return <div className={this.getClasses(nospecial)}
|
|
style={{position:'relative'}}
|
|
style={{position:'relative'}}
|
|
- onClick={allClick?this.handleNumClick:null}
|
|
|
|
|
|
+ /*onClick={allClick?this.handleNumClick:null}*/
|
|
onMouseUp={()=>handleMouseUp({select_start,i,boxMark})}
|
|
onMouseUp={()=>handleMouseUp({select_start,i,boxMark})}
|
|
onMouseDown={this.handleMouseDown.bind(this)}>
|
|
onMouseDown={this.handleMouseDown.bind(this)}>
|
|
- <span className={`${setFontColorSize(val?'':isSelectAll?2:isExtBlue?2:1)} prefixUnset`}>{prefix}</span>
|
|
|
|
|
|
+ <span onClick={allClick?this.handleNumClick:null} className={`${setFontColorSize(val?'':isSelectAll?2:isExtBlue?2:1)} prefixUnset`}>{prefix}</span>
|
|
<span onFocus={this.handleNumFocus}
|
|
<span onFocus={this.handleNumFocus}
|
|
- onClick={allClick?null:this.handleNumClick}
|
|
|
|
|
|
+ onClick={e=>e.stopPropagation()}
|
|
contentEditable={true}
|
|
contentEditable={true}
|
|
style={{minWidth:'10px',display:'inline-block',textAlign:'center'}}
|
|
style={{minWidth:'10px',display:'inline-block',textAlign:'center'}}
|
|
ref = {this.$span}
|
|
ref = {this.$span}
|
|
@@ -286,7 +288,7 @@ class NumberDrop extends Component{
|
|
onInput={this.handleSpanInp}
|
|
onInput={this.handleSpanInp}
|
|
className={`${this.getSpanClass(nospecial)}`}
|
|
className={`${this.getSpanClass(nospecial)}`}
|
|
> {val||placeholder}</span>
|
|
> {val||placeholder}</span>
|
|
- <span className={`${setFontColorSize(val?'':isSelectAll?2:isExtBlue?2:1)} prefixUnset`}>{suffix}</span>
|
|
|
|
|
|
+ <span onClick={allClick?this.handleNumClick:null} className={`${setFontColorSize(val?'':isSelectAll?2:isExtBlue?2:1)} prefixUnset`}>{suffix}</span>
|
|
<NumberPan handleSelect={this.select.bind(this)}
|
|
<NumberPan handleSelect={this.select.bind(this)}
|
|
noString={formulaCode?true:false}
|
|
noString={formulaCode?true:false}
|
|
onClose={handleHide}
|
|
onClose={handleHide}
|