Explorar o código

:memo: add dict input

visuddhinanda %!s(int64=2) %!d(string=hai) anos
pai
achega
6a07d52bd8
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      dashboard/src/components/dict/SearchVocabulary.tsx

+ 3 - 2
dashboard/src/components/dict/SearchVocabulary.tsx

@@ -30,8 +30,9 @@ const SearchVocabularyWidget = ({
   const [factors, setFactors] = useState<string[]>([]);
   const intervalRef = useRef<number | null>(null); //防抖计时器句柄
 
+  console.debug("value", value);
   useEffect(() => {
-    console.log("dict input", value);
+    console.debug("dict input", value);
     setInput(value);
     factorChange(value);
   }, [value]);
@@ -72,7 +73,7 @@ const SearchVocabularyWidget = ({
   };
 
   const factorChange = (word?: string) => {
-    if (typeof word === "undefined") {
+    if (typeof word === "undefined" || word.includes(":")) {
       setFactors([]);
       return;
     }