Преглед на файлове

数字键盘删除bug2596

zhouna преди 5 години
родител
ревизия
dda459c34d
променени са 2 файла, в които са добавени 6 реда и са изтрити 2 реда
  1. 5 2
      src/common/components/NumberPan/index.jsx
  2. 1 0
      src/components/NumberDrop/index.jsx

+ 5 - 2
src/common/components/NumberPan/index.jsx

@@ -46,7 +46,7 @@ class NumberPan extends Component{
     const text = value.substring(0,len);
     this.setState({
       value:text
-    });console.log(text)
+    });
     onSelect&&onSelect(text);
   }
   getStyle(){
@@ -58,8 +58,11 @@ class NumberPan extends Component{
     }
   }
   componentWillReceiveProps(next){
+    //超过范围后重新打开下拉点删除,显示原值bug修改
     if(next.toClear&&!this.props.toClear){
-      this.handleClear();
+      this.setState({
+        value: this.props.value
+      });
     }
   }
   render(){

+ 1 - 0
src/components/NumberDrop/index.jsx

@@ -264,6 +264,7 @@ class NumberDrop extends Component{
       <NumberPan handleSelect={this.select.bind(this)}
                  noString={formulaCode?true:false}
                  onClose={handleHide}
+                 value={this.state.value}
                  show={show}
                  toClear={!hasSelect}/>
     </div>