antonmedv / codejar

An embeddable code editor for the browser 🍯
https://medv.io/codejar/
MIT License
1.8k stars 116 forks source link

Strg+A Strg+C copies only subselection in Firefox (when plaintext-only is not supported) #88

Closed Gnietschow closed 1 year ago

Gnietschow commented 1 year ago

When I use Strg+A to select all content in Firefox and then Strg+C to copy it, it won't copy the whole content. It can easily tested by opening https://medv.io/codejar/ in Firefox and trying that in the first code editor.

I tracked that issue down to the line if (isLegacy) restore(save()); in the keydown handler, which seems to move the selection end unexpectedly before the copy is handled.

antonmedv commented 1 year ago

Well. Firefox has to many bugs in wyswyg editor. I give up to fix bugs in Firefox. You can try to fix and PR ;)

PS it’s literally bugs in ff. not different with blink/webkit.

Gnietschow commented 1 year ago

Understandable :) Do you remember for which case the line was added? If I remove it, it seems to work normally for me. But of course I'm not seeing the whole picture. I would make a PR with an exempt for that line in case of a Strg+C if that is ok for you.

antonmedv commented 1 year ago

Not remember unfortunately. I’ll gonna try to add some test to cover this part.

Gnietschow commented 1 year ago

I created a PR for the issue. My first one ever, so please tell me if I made something wrong :)

antonmedv commented 1 year ago

Released 3.7.0