Browse Source

数字键盘删除bug2596

zhouna 5 years ago
parent
commit
971c79d8bd
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/common/components/NumberPan/index.jsx

+ 6 - 1
src/common/components/NumberPan/index.jsx

@@ -22,7 +22,7 @@ class NumberPan extends Component{
     onSelect&&onSelect(value+text);
   }
   handleClear(e){
-    e.stopPropagation();
+    e&&e.stopPropagation();
     const onSelect = this.props.handleSelect;
     this.setState({
       value: ''
@@ -57,6 +57,11 @@ class NumberPan extends Component{
       display:show?'table':'none'        //table onBlur阻止冒泡是为了修复multSpread中数字键盘点击触发最外层数字组件onBlur事件
     }
   }
+  componentWillReceiveProps(next){
+    if(next.toClear&&!this.props.toClear){
+      this.handleClear();
+    }
+  }
   render(){
     const select = this.handleSelect;
     const noString=this.props.noString;