Skip to content

Commit

Permalink
feat(chat-ai-demo): Add icon changing to copy button
Browse files Browse the repository at this point in the history
  • Loading branch information
marker dao ® committed Nov 28, 2024
1 parent ead2579 commit 430ab13
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 430ab13

Please sign in to comment.