Преглед на файлове

add getPopupContainer at AutoComplete

visuddhinanda преди 2 години
родител
ревизия
ba1f155309
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      dashboard/src/components/dict/SearchVocabulary.tsx

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

@@ -117,9 +117,13 @@ const SearchVocabularyWidget = ({
     console.log("开始计时");
     intervalRef.current = window.setInterval(search, 500, value);
   };
+
   return (
     <div style={{ width: "100%" }}>
       <AutoComplete
+        getPopupContainer={(node: HTMLElement) =>
+          document.getElementsByClassName("dict_search_div")[0] as HTMLElement
+        }
         value={input}
         style={{ width: "100%" }}
         popupClassName="certain-category-search-dropdown"
@@ -153,7 +157,7 @@ const SearchVocabularyWidget = ({
           }}
         />
       </AutoComplete>
-      <Space>
+      <Space style={{ display: "none" }}>
         {factors.map((item, id) => {
           return (
             <Link