What kind of events can interfere with section?

Hello, when I use CM6 plain - I am able to select code cleanly.

But when I use it as part of my vue 3 app, the code selection is broken. It does not select code. I recently added a lot of event listeners in my app for mouse events. (click, mousedown, mouseup, mousemove)

Is there any documentation on how mouse events in the rest of the app can affect codemirror selection? Are these some events I should not be handling cause they might interfere with CM6’s event handlers?


If your custom mouse event handlers return true or call preventDefault, they will override CodeMirror’s own handling of those events, which would break mouse selection. If that’s not what you are seeing, you’ll have to be a bit more specific.

1 Like

Thanks. Digging into my event handlers. I do use stopPropagation sometimes. But not really preventDefault.

Fixed it. stopPropagation was causing the selection in codemirror to fail. Removed that and handled the propagation explicitly instead - and now it works.