Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In backend, add "click to copy text" feature #3952

Closed
pauldpauld opened this issue Apr 22, 2024 · 1 comment · Fixed by #3960
Closed

In backend, add "click to copy text" feature #3952

pauldpauld opened this issue Apr 22, 2024 · 1 comment · Fixed by #3960

Comments

@pauldpauld
Copy link

pauldpauld commented Apr 22, 2024

Description (*)

I transfer new customer details into my accounting program, always using tedious "copy 'n paste", I have noticed that eBay and other websites have a "click to copy" button, or simply, click on a field which copied the text content.

image

The above is my freight company page with a tracking number, clicking on the graphic copies the tracking number.

Expected behavior (*)

Clicking on a customer name and/or address fields on the order page will copy that text to the clipboard.

Benefits

It would make it much quicker and efficient for admin staff to copy many of the customer details (and or product details) if they don't already use a linked method.

Additional information

Here is a sample from W3schools

` Step 1) Add HTML:
Example
The text field
<input type="text" value="Hello World" id="myInput">
<input type="text" value="Hello World" id="myInput">

The button used to copy the text
<button onclick="myFunction()">Copy text</button>
<button onclick="myFunction()">Copy text</button>

 <!-- The text field -->
<input type="text" value="Hello World" id="myInput">

<!-- The button used to copy the text -->
<button onclick="myFunction()">Copy text</button>

Step 2) Add JavaScript:
Example
function myFunction() {
// Get the text field
var copyText = document.getElementById("myInput");

// Select the text field
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices

// Copy the text inside the text field
navigator.clipboard.writeText(copyText.value);

// Alert the copied text
alert("Copied the text: " + copyText.value);
}
`

@luigifab
Copy link
Collaborator

So good idea! See also #2774.
With Linux you can select any text to copy it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants