Closed jorg-vr closed 2 weeks ago
You'll want to actually bind enter to something with a keymap, like the default keymap.
Oh, you already noticed that I see. The library provides no guarantee on any key behaving in any particular way (beyond text insertion) when you don't bind commands for them.
Oh I didn't know we needed to explicitly add the standard keymap for 'Enter' to work. Odd that this behavior changed between versions though...
Adding to this, it seems that all non-manually binded keymaps are no longer working, examples like: CMD+F
, CMD+Z
. This seems like a regression to me, or at least a breaking change, as this totally borked our editor with the version upgrade.
Ctrl-f works fine for me in that /try link (on Linux). For the undo history you definitely also want to wire in CodeMirror's implementation, since the native one is very flaky on a scripted editor like this.
Just verified that cmd-f also still accesses the browser's native search on macOS Chrome.
This issue is fixed in Codemirror/view 6.28.1
Not really. That version temporarily disables EditContext
, but later versions will enable it again. Just bind commands to your keys, you'll avoid a lot of problems, not just this one.
Describe the issue
Issue
Pressing the 'enter' key when the editor is focused is completely ignored. No newlines are added. Pasting newlines still works.
Version
Codemirror/view 6.28.0 Chrome Version 126.0.6478.55 (Official Build) (64-bit)
Also tested in Firefox and chrome 114. The issue wasn't present there.
Reproduction
Create an editor without extensions
Workaround
Currently fixed by adding an extension:
see: https://github.com/dodona-edu/papyros/pull/710
Browser and platform
Chrome Version 126.0.6478.55 (Official Build) (64-bit) Linux mint
Reproduction link
https://codemirror.net/try/?c=aW1wb3J0IHtiYXNpY1NldHVwLCBFZGl0b3JWaWV3fSBmcm9tICJjb2RlbWlycm9yIgppbXBvcnQge2phdmFzY3JpcHR9IGZyb20gIkBjb2RlbWlycm9yL2xhbmctamF2YXNjcmlwdCIKCm5ldyBFZGl0b3JWaWV3KHsKICBkb2M6ICJjb25zb2xlLmxvZygnaGVsbG8nKVxuIiwKICBleHRlbnNpb25zOiBbXSwKICBwYXJlbnQ6IGRvY3VtZW50LmJvZHkKfSkK