visuddhinanda 2 лет назад
Родитель
Сommit
c8aff943ed
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      dashboard/src/components/dict/Dictionary.tsx

+ 5 - 1
dashboard/src/components/dict/Dictionary.tsx

@@ -117,7 +117,11 @@ const DictionaryWidget = ({ word, compact = false, onSearch }: IWidget) => {
                 onIdChange={(value: string) => {
                   const newInput = `type:term id:${value}`;
                   console.debug("term onIdChange setWordInput", newInput);
-                  setWordInput(newInput);
+                  if (typeof onSearch !== "undefined") {
+                    onSearch(newInput);
+                  } else {
+                    setWordInput(newInput);
+                  }
                 }}
               />
             )}