I am making a toy environment to teach JavaScript. Here is the link to the current version. The HTML book has many chapters available through TOC (the TOC control is in the top right corner) and many textAreas to play with code. Currently, if you select a chapter (a bookmark) and reload the page, it gets positioned on the selected chapter.
I replaced the textAreas with CodeMirror instances. Everything mostly works, except after reloading, the browser scrolls the page to the first CodeMirror wrapper. Funnily, my script finds and converts textAreas from the bottom up, so, as the page loads, I see a fast backward movie where every CodeMirror wrapper appears and disappears. The first one is left, of course.
An excerpt of the next version - the one with CodeMirror – is available here. The top of the page is scrolled out after loading. Like before, please select a chapter from TOC (the TOC control is still in the top right corner). Reload the page, and it will position (but not focus) at the CodeMirror wrapper div.
I have ‘autofocus: false’ in the initialization object, and it works. I could not find anything else.