Explorar o código

输入再删除输入不搜索bug修改

zhouna %!s(int64=6) %!d(string=hai) anos
pai
achega
cd02a522c6
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/common/components/EditableSpan/index.jsx

+ 4 - 1
src/common/components/EditableSpan/index.jsx

@@ -96,8 +96,11 @@ class EditableSpan extends Component{
       temp = newText.replace(searchPre,'');
       isEnd = !(newText.indexOf(searchPre)>0);
       search = temp.replace(/[(^\s*)|(\s*$)|(^\,*)|(\,*$)]/g,'');
+      if(!search&&searchPre){
+        search = searchPre;
+      }
       //console.log(labelVal,'旧:',searchPre,'新:',newText,'搜索:',search);
-      if(config.punctuationReg.test(search)){     //只有标点符号时不搜索
+      if(config.punctuationReg.test(search)){    //只有标点符号时不搜索
         handleSearch&&handleSearch({text:search,isEnd,boxMark,mainIds});
       }else{//只有标点符号时要清空搜索结果
         handleClear && handleClear({boxMark})