Sfoglia il codice sorgente

enter跳下一个关闭弹窗

zhouna 6 anni fa
parent
commit
b23bef4e29
1 ha cambiato i file con 2 aggiunte e 12 eliminazioni
  1. 2 12
      src/components/NumberDrop/index.jsx

+ 2 - 12
src/components/NumberDrop/index.jsx

@@ -95,8 +95,9 @@ class NumberDrop extends Component{
   }
   handleKeyDowm(e){
     if(e.keyCode==13){
-      const {reFocus,num} = this.props;
+      const {reFocus,num,handleHide} = this.props;
       reFocus&&reFocus(num);
+      handleHide && handleHide();
     }
   }
   handleNumClick(e){     //数字框不可编辑的状态时点击事件,点击将数字框变为可输入且下拉不再显示直到失焦后再次聚集
@@ -197,17 +198,6 @@ class NumberDrop extends Component{
     const {handleHide} = this.props;
     handleHide&&handleHide();
   }
-  // handleKeyDowm(e){
-    // handleEnter();
-    //只能输入数字
-    /*const key = e.key;
-    const ctrlOn = e.ctrlKey;
-    const isCopyPaste = ctrlOn&&(key=='v'||key=='c');
-    if((!/[0-9|.|~|\/]/.test(key)&&key.length==1&&!isCopyPaste)){
-      e.preventDefault();
-      return false;
-    }*/
-  // }
   getClasses(){         //整个标签是否有值的状态
     const {hideTag,placeholder,value,isImports} = this.props;
     const val = value;