copy-to-clipboard
copy-to-clipboard copied to clipboard
Safari when copy is made async
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
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