Parcourir la source

add getPopupContainer at AutoComplete

visuddhinanda il y a 2 ans
Parent
commit
ba1f155309
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  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("开始计时");
     console.log("开始计时");
     intervalRef.current = window.setInterval(search, 500, value);
     intervalRef.current = window.setInterval(search, 500, value);
   };
   };
+
   return (
   return (
     <div style={{ width: "100%" }}>
     <div style={{ width: "100%" }}>
       <AutoComplete
       <AutoComplete
+        getPopupContainer={(node: HTMLElement) =>
+          document.getElementsByClassName("dict_search_div")[0] as HTMLElement
+        }
         value={input}
         value={input}
         style={{ width: "100%" }}
         style={{ width: "100%" }}
         popupClassName="certain-category-search-dropdown"
         popupClassName="certain-category-search-dropdown"
@@ -153,7 +157,7 @@ const SearchVocabularyWidget = ({
           }}
           }}
         />
         />
       </AutoComplete>
       </AutoComplete>
-      <Space>
+      <Space style={{ display: "none" }}>
         {factors.map((item, id) => {
         {factors.map((item, id) => {
           return (
           return (
             <Link
             <Link