You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by je...@apache.org on 2024/02/09 17:59:46 UTC
(airflow) 01/26: fix copy-bug (#34904)
This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch v2-8-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit a970d1af038a609de5dbe11bf77f0e45d9112edd
Author: Akash Sharma <35...@users.noreply.github.com>
AuthorDate: Wed Jan 17 03:40:41 2024 +0530
fix copy-bug (#34904)
Co-authored-by: adaverse <ad...@Akash>
(cherry picked from commit 3a48d0c47f439b684511e47340fd24cc3188c4e7)
---
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,