Skip to content

Commit

Permalink
Added stopPropagation to "copy text" buttons in backend (#4019)
Browse files Browse the repository at this point in the history
  • Loading branch information
Caprico85 authored May 29, 2024
1 parent 1fcf745 commit 6cc06b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/varien/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,8 @@ function createCopyIconElement() {
* @param {Event} event - The event object triggered by the click event
*/
function copyText(event) {
event.stopPropagation();
event.preventDefault();
const copyIcon = event.currentTarget;
const copyText = copyIcon.previousElementSibling.getAttribute('data-copy-text');
navigator.clipboard.writeText(copyText);
Expand Down

0 comments on commit 6cc06b3

Please sign in to comment.