From 430ab139dfa1d814f1a2dd744e5299f2c8036993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marker=20dao=20=C2=AE?= Date: Thu, 28 Nov 2024 15:47:06 +0100 Subject: [PATCH] feat(chat-ai-demo): Add icon changing to copy button --- .../Demos/Chat/AIAndChatbotIntegration/jQuery/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/demos/Demos/Chat/AIAndChatbotIntegration/jQuery/index.js b/apps/demos/Demos/Chat/AIAndChatbotIntegration/jQuery/index.js index 2d58e690bf4..19e7c0d4019 100644 --- a/apps/demos/Demos/Chat/AIAndChatbotIntegration/jQuery/index.js +++ b/apps/demos/Demos/Chat/AIAndChatbotIntegration/jQuery/index.js @@ -175,8 +175,12 @@ $(() => { icon: 'copy', stylingMode: 'text', hint: 'Copy', - onClick: () => { + onClick: ({ component }) => { navigator.clipboard.writeText($textElement.text()); + component.option({ icon: 'check' }); + setTimeout(() => { + component.option({ icon: 'copy' }); + }, 5000); }, }) .appendTo($buttonContainer);