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

feat: fullscreen copy

Open haite opened this issue 4 years ago • 5 comments

haite avatar Aug 04 '20 12:08 haite

This looks really interesting. We have an issue where no text is copied in Chrome when we have expanded an element to full screen (as distinct from the entire browser page beign full screen). Is this a scenario in mind here? Is there any progress here?

daggmano avatar Nov 11 '20 23:11 daggmano

This looks really interesting. We have an issue where no text is copied in Chrome when we have expanded an element to full screen (as distinct from the entire browser page beign full screen). Is this a scenario in mind here? Is there any progress here?

yes, but CI build failed.

haite avatar Nov 12 '20 01:11 haite

Help me out, can't understand this fully. If we have fullscreen, which container would work and why document.body doesn't?

sudodoki avatar Nov 12 '20 16:11 sudodoki

Yeah, looks like this is not required. We had a weird issue where the clipboard copy wasn't working in Chrome (only) when in full-screen mode, but the full-screen was from a React element rather than F11. A bit obscure. Anyway, I went down the above path but it made no difference in the end. We ended up using code to try the native navigator.clipboard.writeText() method first, and only falling back to copy-to-clipboard if this wasn't available or failed. It would be good if that was an integral step in this package, so that e.g react-copy-to-clipboard can benefit from this. I had a think about a PR to do that, it's not hard, but would mean the callback would change (no data to send back). Since that's a breaking change to the API that's your call.

daggmano avatar Nov 13 '20 03:11 daggmano

@daggmano yeah, given #108 and overall feeling about this project, I would probably envision transitioning into navigator.clipboard and deprecating this library altogether

sudodoki avatar Nov 13 '20 11:11 sudodoki