marijnh/CodeMirror2 — Issue #221: Browser's Find command doesn't properly work with CodeMirror editor
Author: nicknotfound
Created: 2011-10-27 19:49:39+00:00
State: open

When using a CodeMirror editor that is taller than the browser window (such as an auto-resizing editor) and searching for a word using the browser's built-in Find functionality (e.g., Edit > Find), if any occurrences appear in the CodeMirror editor, the browser scrolls to the very bottom of the page regardless of where the first occurrence is.

Also, the browser's Find Next command only "stops" once in a CodeMirror editor regardless of how many search match occurrences are in the editor. I can tell that Chrome sees all the occurrences, because the Find UI that drops down from the upper right of the browser window says "1 of 40".

To see an example of these behaviors, open the [Auto-resizing editor demo](http://codemirror.net/demo/resize.html) page and copy/paste the editor's content several times over until it becomes tall enough to cause the browser window to have a vertical scroll bar. I have tried this in Chrome and Safari on OS X.

These are difficult behaviors to explain, but the gist of it is that CodeMirror seems to confuse the browser's Find functionality. I know I can use CodeMirror's built-in find/replace, and I'm headed in that direction, but I thought it was worth bringing this up.

And as always, thanks for such an awesome in-browser editor!