Open rlpacht opened 8 years ago
@rlpacht which browser are you experiencing this in? Can you provide codepen/jsfiddle/jsbin with reproducible keys? Supposedly, https://github.com/sudodoki/copy-to-clipboard/commit/30590d47b9f4ae7d77e7d674ec206fefe2c94a49#diff-168726dbe96b3ce427e7fedce31bb0bcR26 should force this to have no background whatsoever
It's happening for me in chrome.
@sudodoki This issue is happening for me in chrome as well when I paste into Google Sheets. When I perform the paste, the background color of the cells is this grey color.
@shrey18111 not sure what you mean - is Google Sheets using this library?
@sudodoki This issue is happening for me when I had styles for body element http://codepen.io/AArrabal/pen/dNzKjq?editors=0110
this would be fixed by fixing https://github.com/sudodoki/copy-to-clipboard/issues/47 - by specifying 'text/plain' as the format type.
Until then, you can get around it by adding:
document.addEventListener('copy', e => {
e.clipboardData.setData('text/html', STRING_TO_COPY);
e.preventDefault();
});
see updated codepen: http://codepen.io/anon/pen/KWQxXG?editors=0110
@gravitypersists doesn't seem to be working in latest Chrome
Oh, that's because of text/html
in the example, Should be text/plain
😄
This is pretty much the same issue as #43 but now the background is grey instead of yellow. Do you know what might cause this and if there is a way to make that not happen?