A number of times recently, I have attempted to copy code from the Snippet editor in order to paste it into either JS Fiddle (which I prefer for code experimentation) or VS Code. In many situations – using either Ubuntu 20.04, or Windows 10 – with either Chrome 90 or Firefox 87 this has resulted in only the hyphen character (-
) being pasted into the relevant editor.
I have tried both: ctrl+a, and clicking-and-dragging to create a selection and then ctrl+c to copy, or right-clicking the selection and selecting 'copy' from the context-menu.
When pasting I've tried both ctrl+v and right-click, then 'paste.'
And – though it's not the same for all questions – in those instances where copy/paste doesn't work, it fails to work for all variations of the above.
Selecting the text, and then dragging that text-selection into the program, or tab, does work however.
This question is the most-recent question in which I've observed the behaviour: Iterate 2 tables to show difference of each row element in a popup
To reproduce:
- Copy Snippet to answer,
- Scroll down the page to see the 'preview',
- Click on 'Edit the above Snippet',
- Select and copy the text from either the HTML or JS portions (CSS seems unaffected),
- Paste into VS Code or JS Fiddle.
But it's happened a number of times over the past fortnight or so.
It doesn't occur in text/code copied from the answer itself, but only in code that's within the Snippet editor; copying text from within the Snippet markup, but while in the answer-editor works perfectly well.
I'm assuming it's a bug in the text-selection/Clipboard API, but I aren't really sure at this point.