Shift+Ctrl+V to strip/preserve formatting of pasted text results in text being pasted twice in 2.1.45

It seems editor.onPaste is triggered twice when using Shift+Ctrl+V.
Using paste action in the context menu with Shift works normally.

Tested on Windows 10.

2 Likes

I haven’t tried the stable yet but I have the same problem in 45 Beta (on linux)

Cannot reproduce on macOS.

I was able to reproduce the issue on Windows. I think the cause is that bridgeCommand("paste") is being called from the following two locations when ctrl + shift + v is pressed.

https://github.com/ankitects/anki/blob/355e66e83ceb447fcc85c96c82476041817b4026/ts/editor/editing-area.ts#L76

https://github.com/ankitects/anki/blob/355e66e83ceb447fcc85c96c82476041817b4026/ts/editor/index.ts#L49

It appears that the “paste” event fires even when ctrl + shift + v is pressed, at least on chrome/chromium on Windows.

2 Likes

@hengiesel 's just sent through a fix

2 Likes