Răsfoiți Sursa

watch dropdownOpen

yusuketk 5 ani în urmă
părinte
comite
e57497090b
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      src/client/js/components/Page/CopyDropdown.jsx

+ 2 - 2
src/client/js/components/Page/CopyDropdown.jsx

@@ -41,7 +41,7 @@ const CopyDropdown = (props) => {
    * functions to construct labels and URLs
    */
   const getUriParams = useCallback(() => {
-    if (!isParamsAppended) {
+    if (!isParamsAppended || !dropdownOpen) {
       return '';
     }
 
@@ -50,7 +50,7 @@ const CopyDropdown = (props) => {
     } = window.location;
 
     return `${search}${hash}`;
-  }, [isParamsAppended]);
+  }, [isParamsAppended, dropdownOpen]);
 
   const pagePathWithParams = useMemo(() => {
     const { pagePath } = props;