This is an automated email from the ASF dual-hosted git repository.
bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 3a48d0c47f fix copy-bug (#34904)
3a48d0c47f is described below
commit 3a48d0c47f439b684511e47340fd24cc3188c4e7
Author: Akash Sharma <[email protected]>
AuthorDate: Wed Jan 17 03:40:41 2024 +0530
fix copy-bug (#34904)
Co-authored-by: adaverse <adaverse@Akash>
---
airflow/www/static/js/components/Clipboard.tsx | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/airflow/www/static/js/components/Clipboard.tsx
b/airflow/www/static/js/components/Clipboard.tsx
index 0e0a5d451b..11b2547c1e 100644
--- a/airflow/www/static/js/components/Clipboard.tsx
+++ b/airflow/www/static/js/components/Clipboard.tsx
@@ -17,7 +17,7 @@
* under the License.
*/
-import React from "react";
+import React, { useEffect } from "react";
import {
Button,
IconButton,
@@ -43,9 +43,13 @@ export const ClipboardButton = forwardRef(
},
ref
) => {
- const { hasCopied, onCopy } = useClipboard(value);
+ const { setValue, hasCopied, onCopy } = useClipboard(value);
const containerRef = useContainerRef();
+ useEffect(() => {
+ setValue(value);
+ }, [value, setValue]);
+
const commonProps = {
onClick: onCopy,
variant,