Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
jitsi-meet/react/features/invite/components/add-people-dialog/web/utils.js

23 lines
514 B

// @flow
/**
* Tries to copy a given text to the clipboard.
*
* @param {string} textToCopy - Text to be copied.
* @returns {boolean}
*/
export function copyText(textToCopy: string) {
const fakeTextArea = document.createElement('textarea');
// $FlowFixMe
document.body.appendChild(fakeTextArea);
fakeTextArea.value = textToCopy;
fakeTextArea.select();
const result = document.execCommand('copy');
// $FlowFixMe
document.body.removeChild(fakeTextArea);
return result;
}