2

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.

3
  • Can not reproduce in Win 10 copying JS from snippet editor in both FF & Chrome to Fiddle and VS Code. Are you using any userscripts that affect snippet editor?
    – charlietfl
    Commented Apr 25, 2021 at 20:21
  • Strange. After good pastes I went back to still open snippet editor in previous tab and only thing left in the JS code block was a hyphen. Sounds like opposite to behavior you noted
    – charlietfl
    Commented Apr 25, 2021 at 20:30
  • No, there are no scripts or extensions installed in any of my browsers. The problem is that there's no reliable pattern for when this occurs, but when it does occur it's across both browsers. Though when it occurs at work I only have Windows 10, and at home only Ubuntu 20.04; so I can't test the same question, browser across different platforms in succession unfortunately. Commented Apr 25, 2021 at 23:27

0

You must log in to answer this question.

Browse other questions tagged .