chore: Replace packages with native functions (#5140)
This commit is contained in:
14
app/javascript/shared/helpers/clipboard.js
Normal file
14
app/javascript/shared/helpers/clipboard.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Writes a text string to the system clipboard.
|
||||
*
|
||||
* @async
|
||||
* @param {string} text text to be written to the clipboard
|
||||
* @throws {Error} unable to copy text to clipboard
|
||||
*/
|
||||
export const copyTextToClipboard = async text => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
} catch (error) {
|
||||
throw new Error(`Unable to copy text to clipboard: ${error.message}`);
|
||||
}
|
||||
};
|
||||
@@ -1,5 +1,3 @@
|
||||
// import groupBy from 'lodash.groupby';
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
setFilterAttributes() {
|
||||
|
||||
Reference in New Issue
Block a user