find next in a cell editor box does not move the caret

In a normal browser text box when using Safari (and in almost every other text editing widget on Mac OS), the “Find Next” command locates and selects the next copy of whatever bit of text is currently in the find clipboard. This is very convenient, because the ⌘E shortcut sends the current selection to the find clipboard, and then the ⌘G shortcut selects the next copy of it. Then that selected text will be replaced when pressing delete, some other letter, ⌘V to paste the content of the regular clipboard, or the like.

However, in Observable code editor boxes, the text appears to be selected but the caret does not move. If I paste or type, the result goes where the caret was previously, not into the place of the apparent selection.

This breaks years or decades of basic Mac text editing muscle memory, and is very frustrating.

(Google Chrome has some broken totally non-platform-related find/replace system which I haven’t tried to figure out, so this might not apply there.)

(P.S. if Observable had a read/write notebook editing API, I could use my own preferred text editor, and the quirks of underpowered buggy browser text boxes would be a lot less frustrating.)

[Edited to clarify code editor boxes, not inputs rendered in cell output]

Interesting. I’ll pass that on to the team in case it’s something we can easily fix. Thanks.

Are you referring to code editors (CodeMirror) here, or text inputs in modals (e.g., in user settings)?

I mean the code editors. Yes this seems to be a general CodeMirror problem. The example at https://codemirror.net is also broken.

Edit: CodeMirror has some kind of “search addon” https://codemirror.net/doc/manual.html#addons so maybe there’s a not-too-onerous way to get find working more or less as someone might expect.

On the other hand, https://codemirror.net/2/demo/search.html doesn’t work for me, so maybe that’s not going to be useful either.

Another edit: this one seems to more or less work, but its demo seems to have some additional extra features enabled that are a bit visually distracting. I didn’t investigate whether those are all packaged together or if the plain search behavior can stand alone. https://github.com/kofifus/CodeMirrorSearch