Posts

Showing posts from October, 2022

Copy to Clipboard in LWC

async copyApiName(){         let msg = `${this.paramString}`;         if (navigator.clipboard && window.isSecureContext) {             return navigator.clipboard.writeText(msg);         } else {             let textArea = document.createElement("textarea");             textArea.value = msg;             textArea.style.position = "fixed";             textArea.style.left = "-999999px";             textArea.style.top = "-999999px";             document.body.appendChild(textArea);             textArea.focus();             textArea.select();             return new Promise((res, rej) => {            ...