Wrong selection when using CodeMirror in ProseMirror

Hi, marijn

I’m facing some problems while using CodeMirror in ProseMirror

As shown by the pic(by Embeded CodeMirror

Sometimes, when click outside the code_block node, the cursor shown by the dom was right but the editor selection was pointed at the end of the code_block content.

And the toolbar state is uncorrent.

Is there a way to fix this selection error?

Hi. Do you have more precise instructions on how to make this occur? In which browser does it happen?

thanks for your reply! the step to make this occur as the following:

  1. click inside code_block
  2. click the nearest paragarph

repeat step1 and step2 when the menuItem still disabled, the editor selection is wrong. my browser is Chorme 77.0.3865.90

I’ve been clicking for a while (also Chrome 77), but I’m not seeing this for some reason.

It seems that I’m running into the situation.

But the pos doesn’t equal to neither selection.from nor selection.to.

It points at the next paragraph.

why should it be equal?