Parcourir la source

add onSearch in TermShow

visuddhinanda il y a 2 ans
Parent
commit
c8aff943ed
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  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);
+                  }
                 }}
               />
             )}