copy-to-clipboard icon indicating copy to clipboard operation
copy-to-clipboard copied to clipboard

Safari when copy is made async

Open tonypee opened this issue 4 years ago • 1 comments

It seems that the click handler cannot load data? or do other pre-processing?

Example:

https://codesandbox.io/s/ecstatic-chaplygin-enmpd?file=/src/App.js

tonypee avatar Dec 03 '20 05:12 tonypee

it might be that it relies on sync handler and want execCommand to be invoked immediately after user interaction due to security policy. Wonder whether it's going to be the same with synchronous XMLHTTPrequest https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Synchronous_and_Asynchronous_Requests#Synchronous_request althought it might be deprecated in main thread. Possibly could try to prefetch items / split into two steps (click -> loader -> ready, click here to copy), but it might be too much trouble and not applicable for every case

sudodoki avatar Dec 03 '20 11:12 sudodoki